<!DOCTYPE html><html class=docs lang=en><meta charset=utf-8><meta content=#3492ff name=theme-color><meta content="width=device-width,initial-scale=1" name=viewport><title>Lodash Documentation</title><link href=/icons/apple-touch-180x180.png rel=apple-touch-icon sizes=180x180><link href=https://github.com/lodash/lodash/commits/master.atom rel=feed type=application/atom+xml><link href=/icons/favicon-32x32.png rel=icon sizes=32x32 type=image/png><link href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEVMaXExk//ImxjuAAAAAXRSTlMAQObYZgAAAA9JREFUeAFjIBLU/2MC0wALJgGAaiAmLQAAAABJRU5ErkJggg==" rel=icon sizes=16x16 type=image/png><link href=/manifest.json rel=manifest><link href=/icons/safari-pinned-tab-16x16.svg rel=mask-icon color=#3492ff><link href=/assets/css/main.css rel=stylesheet><noscript><link href=/vendor/cdn.jsdelivr.net/fontawesome/4.6.3/css/font-awesome.min.css rel=stylesheet crossorigin=anonymous integrity=sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1></noscript><script async src=/assets/js/boot.js></script><body class=layout-docs><header><div class=container><div class="header-section logo-section"><div class=logo><a href=/ title=Lodash>Lodash</a></div><div class=header-group><select id=version><option value="" disabled>Version<option value=4.17.2 selected>4.17.2<option value=3.10.1>3.10.1<option value=2.4.2>2.4.2<option value=1.3.1>1.3.1</select></div></div><div class="header-section mobile-menu"><a href=#><i class="fa fa-bars" aria-hidden=true></i>Menu</a></div></div></header><div class=doc-main><div class=toc-container><div><h2><code>Array</code></h2><ul><li><a href=#chunk><code>_.chunk</code></a><li><a href=#compact><code>_.compact</code></a><li><a href=#concat><code>_.concat</code></a><li><a href=#difference><code>_.difference</code></a><li><a href=#differenceBy><code>_.differenceBy</code></a><li><a href=#differenceWith><code>_.differenceWith</code></a><li><a href=#drop><code>_.drop</code></a><li><a href=#dropRight><code>_.dropRight</code></a><li><a href=#dropRightWhile><code>_.dropRightWhile</code></a><li><a href=#dropWhile><code>_.dropWhile</code></a><li><a href=#fill><code>_.fill</code></a><li><a href=#findIndex><code>_.findIndex</code></a><li><a href=#findLastIndex><code>_.findLastIndex</code></a><li><a href=#head class=alias><code>_.first</code> -> <code>head</code></a><li><a href=#flatten><code>_.flatten</code></a><li><a href=#flattenDeep><code>_.flattenDeep</code></a><li><a href=#flattenDepth><code>_.flattenDepth</code></a><li><a href=#fromPairs><code>_.fromPairs</code></a><li><a href=#head><code>_.head</code></a><li><a href=#indexOf><code>_.indexOf</code></a><li><a href=#initial><code>_.initial</code></a><li><a href=#intersection><code>_.intersection</code></a><li><a href=#intersectionBy><code>_.intersectionBy</code></a><li><a href=#intersectionWith><code>_.intersectionWith</code></a><li><a href=#join><code>_.join</code></a><li><a href=#last><code>_.last</code></a><li><a href=#lastIndexOf><code>_.lastIndexOf</code></a><li><a href=#nth><code>_.nth</code></a><li><a href=#pull><code>_.pull</code></a><li><a href=#pullAll><code>_.pullAll</code></a><li><a href=#pullAllBy><code>_.pullAllBy</code></a><li><a href=#pullAllWith><code>_.pullAllWith</code></a><li><a href=#pullAt><code>_.pullAt</code></a><li><a href=#remove><code>_.remove</code></a><li><a href=#reverse><code>_.reverse</code></a><li><a href=#slice><code>_.slice</code></a><li><a href=#sortedIndex><code>_.sortedIndex</code></a><li><a href=#sortedIndexBy><code>_.sortedIndexBy</code></a><li><a href=#sortedIndexOf><code>_.sortedIndexOf</code></a><li><a href=#sortedLastIndex><code>_.sortedLastIndex</code></a><li><a href=#sortedLastIndexBy><code>_.sortedLastIndexBy</code></a><li><a href=#sortedLastIndexOf><code>_.sortedLastIndexOf</code></a><li><a href=#sortedUniq><code>_.sortedUniq</code></a><li><a href=#sortedUniqBy><code>_.sortedUniqBy</code></a><li><a href=#tail><code>_.tail</code></a><li><a href=#take><code>_.take</code></a><li><a href=#takeRight><code>_.takeRight</code></a><li><a href=#takeRightWhile><code>_.takeRightWhile</code></a><li><a href=#takeWhile><code>_.takeWhile</code></a><li><a href=#union><code>_.union</code></a><li><a href=#unionBy><code>_.unionBy</code></a><li><a href=#unionWith><code>_.unionWith</code></a><li><a href=#uniq><code>_.uniq</code></a><li><a href=#uniqBy><code>_.uniqBy</code></a><li><a href=#uniqWith><code>_.uniqWith</code></a><li><a href=#unzip><code>_.unzip</code></a><li><a href=#unzipWith><code>_.unzipWith</code></a><li><a href=#without><code>_.without</code></a><li><a href=#xor><code>_.xor</code></a><li><a href=#xorBy><code>_.xorBy</code></a><li><a href=#xorWith><code>_.xorWith</code></a><li><a href=#zip><code>_.zip</code></a><li><a href=#zipObject><code>_.zipObject</code></a><li><a href=#zipObjectDeep><code>_.zipObjectDeep</code></a><li><a href=#zipWith><code>_.zipWith</code></a></ul></div><div><h2><code>Collection</code></h2><ul><li><a href=#countBy><code>_.countBy</code></a><li><a href=#forEach class=alias><code>_.each</code> -> <code>forEach</code></a><li><a href=#forEachRight class=alias><code>_.eachRight</code> -> <code>forEachRight</code></a><li><a href=#every><code>_.every</code></a><li><a href=#filter><code>_.filter</code></a><li><a href=#find><code>_.find</code></a><li><a href=#findLast><code>_.findLast</code></a><li><a href=#flatMap><code>_.flatMap</code></a><li><a href=#flatMapDeep><code>_.flatMapDeep</code></a><li><a href=#flatMapDepth><code>_.flatMapDepth</code></a><li><a href=#forEach><code>_.forEach</code></a><li><a href=#forEachRight><code>_.forEachRight</code></a><li><a href=#groupBy><code>_.groupBy</code></a><li><a href=#includes><code>_.includes</code></a><li><a href=#invokeMap><code>_.invokeMap</code></a><li><a href=#keyBy><code>_.keyBy</code></a><li><a href=#map><code>_.map</code></a><li><a href=#orderBy><code>_.orderBy</code></a><li><a href=#partition><code>_.partition</code></a><li><a href=#reduce><code>_.reduce</code></a><li><a href=#reduceRight><code>_.reduceRight</code></a><li><a href=#reject><code>_.reject</code></a><li><a href=#sample><code>_.sample</code></a><li><a href=#sampleSize><code>_.sampleSize</code></a><li><a href=#shuffle><code>_.shuffle</code></a><li><a href=#size><code>_.size</code></a><li><a href=#some><code>_.some</code></a><li><a href=#sortBy><code>_.sortBy</code></a></ul></div><div><h2><code>Date</code></h2><ul><li><a href=#now><code>_.now</code></a></ul></div><div><h2><code>Function</code></h2><ul><li><a href=#after><code>_.after</code></a><li><a href=#ary><code>_.ary</code></a><li><a href=#before><code>_.before</code></a><li><a href=#bind><code>_.bind</code></a><li><a href=#bindKey><code>_.bindKey</code></a><li><a href=#curry><code>_.curry</code></a><li><a href=#curryRight><code>_.curryRight</code></a><li><a href=#debounce><code>_.debounce</code></a><li><a href=#defer><code>_.defer</code></a><li><a href=#delay><code>_.delay</code></a><li><a href=#flip><code>_.flip</code></a><li><a href=#memoize><code>_.memoize</code></a><li><a href=#negate><code>_.negate</code></a><li><a href=#once><code>_.once</code></a><li><a href=#overArgs><code>_.overArgs</code></a><li><a href=#partial><code>_.partial</code></a><li><a href=#partialRight><code>_.partialRight</code></a><li><a href=#rearg><code>_.rearg</code></a><li><a href=#rest><code>_.rest</code></a><li><a href=#spread><code>_.spread</code></a><li><a href=#throttle><code>_.throttle</code></a><li><a href=#unary><code>_.unary</code></a><li><a href=#wrap><code>_.wrap</code></a></ul></div><div><h2><code>Lang</code></h2><ul><li><a href=#castArray><code>_.castArray</code></a><li><a href=#clone><code>_.clone</code></a><li><a href=#cloneDeep><code>_.cloneDeep</code></a><li><a href=#cloneDeepWith><code>_.cloneDeepWith</code></a><li><a href=#cloneWith><code>_.cloneWith</code></a><li><a href=#conformsTo><code>_.conformsTo</code></a><li><a href=#eq><code>_.eq</code></a><li><a href=#gt><code>_.gt</code></a><li><a href=#gte><code>_.gte</code></a><li><a href=#isArguments><code>_.isArguments</code></a><li><a href=#isArray><code>_.isArray</code></a><li><a href=#isArrayBuffer><code>_.isArrayBuffer</code></a><li><a href=#isArrayLike><code>_.isArrayLike</code></a><li><a href=#isArrayLikeObject><code>_.isArrayLikeObject</code></a><li><a href=#isBoolean><code>_.isBoolean</code></a><li><a href=#isBuffer><code>_.isBuffer</code></a><li><a href=#isDate><code>_.isDate</code></a><li><a href=#isElement><code>_.isElement</code></a><li><a href=#isEmpty><code>_.isEmpty</code></a><li><a href=#isEqual><code>_.isEqual</code></a><li><a href=#isEqualWith><code>_.isEqualWith</code></a><li><a href=#isError><code>_.isError</code></a><li><a href=#isFinite><code>_.isFinite</code></a><li><a href=#isFunction><code>_.isFunction</code></a><li><a href=#isInteger><code>_.isInteger</code></a><li><a href=#isLength><code>_.isLength</code></a><li><a href=#isMap><code>_.isMap</code></a><li><a href=#isMatch><code>_.isMatch</code></a><li><a href=#isMatchWith><code>_.isMatchWith</code></a><li><a href=#isNaN><code>_.isNaN</code></a><li><a href=#isNative><code>_.isNative</code></a><li><a href=#isNil><code>_.isNil</code></a><li><a href=#isNull><code>_.isNull</code></a><li><a href=#isNumber><code>_.isNumber</code></a><li><a href=#isObject><code>_.isObject</code></a><li><a href=#isObjectLike><code>_.isObjectLike</code></a><li><a href=#isPlainObject><code>_.isPlainObject</code></a><li><a href=#isRegExp><code>_.isRegExp</code></a><li><a href=#isSafeInteger><code>_.isSafeInteger</code></a><li><a href=#isSet><code>_.isSet</code></a><li><a href=#isString><code>_.isString</code></a><li><a href=#isSymbol><code>_.isSymbol</code></a><li><a href=#isTypedArray><code>_.isTypedArray</code></a><li><a href=#isUndefined><code>_.isUndefined</code></a><li><a href=#isWeakMap><code>_.isWeakMap</code></a><li><a href=#isWeakSet><code>_.isWeakSet</code></a><li><a href=#lt><code>_.lt</code></a><li><a href=#lte><code>_.lte</code></a><li><a href=#toArray><code>_.toArray</code></a><li><a href=#toFinite><code>_.toFinite</code></a><li><a href=#toInteger><code>_.toInteger</code></a><li><a href=#toLength><code>_.toLength</code></a><li><a href=#toNumber><code>_.toNumber</code></a><li><a href=#toPlainObject><code>_.toPlainObject</code></a><li><a href=#toSafeInteger><code>_.toSafeInteger</code></a><li><a href=#toString><code>_.toString</code></a></ul></div><div><h2><code>Math</code></h2><ul><li><a href=#add><code>_.add</code></a><li><a href=#ceil><code>_.ceil</code></a><li><a href=#divide><code>_.divide</code></a><li><a href=#floor><code>_.floor</code></a><li><a href=#max><code>_.max</code></a><li><a href=#maxBy><code>_.maxBy</code></a><li><a href=#mean><code>_.mean</code></a><li><a href=#meanBy><code>_.meanBy</code></a><li><a href=#min><code>_.min</code></a><li><a href=#minBy><code>_.minBy</code></a><li><a href=#multiply><code>_.multiply</code></a><li><a href=#round><code>_.round</code></a><li><a href=#subtract><code>_.subtract</code></a><li><a href=#sum><code>_.sum</code></a><li><a href=#sumBy><code>_.sumBy</code></a></ul></div><div><h2><code>Number</code></h2><ul><li><a href=#clamp><code>_.clamp</code></a><li><a href=#inRange><code>_.inRange</code></a><li><a href=#random><code>_.random</code></a></ul></div><div><h2><code>Object</code></h2><ul><li><a href=#assign><code>_.assign</code></a><li><a href=#assignIn><code>_.assignIn</code></a><li><a href=#assignInWith><code>_.assignInWith</code></a><li><a href=#assignWith><code>_.assignWith</code></a><li><a href=#at><code>_.at</code></a><li><a href=#create><code>_.create</code></a><li><a href=#defaults><code>_.defaults</code></a><li><a href=#defaultsDeep><code>_.defaultsDeep</code></a><li><a href=#toPairs class=alias><code>_.entries</code> -> <code>toPairs</code></a><li><a href=#toPairsIn class=alias><code>_.entriesIn</code> -> <code>toPairsIn</code></a><li><a href=#assignIn class=alias><code>_.extend</code> -> <code>assignIn</code></a><li><a href=#assignInWith class=alias><code>_.extendWith</code> -> <code>assignInWith</code></a><li><a href=#findKey><code>_.findKey</code></a><li><a href=#findLastKey><code>_.findLastKey</code></a><li><a href=#forIn><code>_.forIn</code></a><li><a href=#forInRight><code>_.forInRight</code></a><li><a href=#forOwn><code>_.forOwn</code></a><li><a href=#forOwnRight><code>_.forOwnRight</code></a><li><a href=#functions><code>_.functions</code></a><li><a href=#functionsIn><code>_.functionsIn</code></a><li><a href=#get><code>_.get</code></a><li><a href=#has><code>_.has</code></a><li><a href=#hasIn><code>_.hasIn</code></a><li><a href=#invert><code>_.invert</code></a><li><a href=#invertBy><code>_.invertBy</code></a><li><a href=#invoke><code>_.invoke</code></a><li><a href=#keys><code>_.keys</code></a><li><a href=#keysIn><code>_.keysIn</code></a><li><a href=#mapKeys><code>_.mapKeys</code></a><li><a href=#mapValues><code>_.mapValues</code></a><li><a href=#merge><code>_.merge</code></a><li><a href=#mergeWith><code>_.mergeWith</code></a><li><a href=#omit><code>_.omit</code></a><li><a href=#omitBy><code>_.omitBy</code></a><li><a href=#pick><code>_.pick</code></a><li><a href=#pickBy><code>_.pickBy</code></a><li><a href=#result><code>_.result</code></a><li><a href=#set><code>_.set</code></a><li><a href=#setWith><code>_.setWith</code></a><li><a href=#toPairs><code>_.toPairs</code></a><li><a href=#toPairsIn><code>_.toPairsIn</code></a><li><a href=#transform><code>_.transform</code></a><li><a href=#unset><code>_.unset</code></a><li><a href=#update><code>_.update</code></a><li><a href=#updateWith><code>_.updateWith</code></a><li><a href=#values><code>_.values</code></a><li><a href=#valuesIn><code>_.valuesIn</code></a></ul></div><div><h2><code>Seq</code></h2><ul><li><a href=#lodash><code>_</code></a><li><a href=#chain><code>_.chain</code></a><li><a href=#tap><code>_.tap</code></a><li><a href=#thru><code>_.thru</code></a><li><a href=#prototype-Symbol-iterator><code>_.prototype[Symbol.iterator]</code></a><li><a href=#prototype-at><code>_.prototype.at</code></a><li><a href=#prototype-chain><code>_.prototype.chain</code></a><li><a href=#prototype-commit><code>_.prototype.commit</code></a><li><a href=#prototype-next><code>_.prototype.next</code></a><li><a href=#prototype-plant><code>_.prototype.plant</code></a><li><a href=#prototype-reverse><code>_.prototype.reverse</code></a><li><a href=#prototype-value class=alias><code>_.prototype.toJSON</code> -> <code>value</code></a><li><a href=#prototype-value><code>_.prototype.value</code></a><li><a href=#prototype-value class=alias><code>_.prototype.valueOf</code> -> <code>value</code></a></ul></div><div><h2><code>String</code></h2><ul><li><a href=#camelCase><code>_.camelCase</code></a><li><a href=#capitalize><code>_.capitalize</code></a><li><a href=#deburr><code>_.deburr</code></a><li><a href=#endsWith><code>_.endsWith</code></a><li><a href=#escape><code>_.escape</code></a><li><a href=#escapeRegExp><code>_.escapeRegExp</code></a><li><a href=#kebabCase><code>_.kebabCase</code></a><li><a href=#lowerCase><code>_.lowerCase</code></a><li><a href=#lowerFirst><code>_.lowerFirst</code></a><li><a href=#pad><code>_.pad</code></a><li><a href=#padEnd><code>_.padEnd</code></a><li><a href=#padStart><code>_.padStart</code></a><li><a href=#parseInt><code>_.parseInt</code></a><li><a href=#repeat><code>_.repeat</code></a><li><a href=#replace><code>_.replace</code></a><li><a href=#snakeCase><code>_.snakeCase</code></a><li><a href=#split><code>_.split</code></a><li><a href=#startCase><code>_.startCase</code></a><li><a href=#startsWith><code>_.startsWith</code></a><li><a href=#template><code>_.template</code></a><li><a href=#toLower><code>_.toLower</code></a><li><a href=#toUpper><code>_.toUpper</code></a><li><a href=#trim><code>_.trim</code></a><li><a href=#trimEnd><code>_.trimEnd</code></a><li><a href=#trimStart><code>_.trimStart</code></a><li><a href=#truncate><code>_.truncate</code></a><li><a href=#unescape><code>_.unescape</code></a><li><a href=#upperCase><code>_.upperCase</code></a><li><a href=#upperFirst><code>_.upperFirst</code></a><li><a href=#words><code>_.words</code></a></ul></div><div><h2><code>Util</code></h2><ul><li><a href=#attempt><code>_.attempt</code></a><li><a href=#bindAll><code>_.bindAll</code></a><li><a href=#cond><code>_.cond</code></a><li><a href=#conforms><code>_.conforms</code></a><li><a href=#constant><code>_.constant</code></a><li><a href=#defaultTo><code>_.defaultTo</code></a><li><a href=#flow><code>_.flow</code></a><li><a href=#flowRight><code>_.flowRight</code></a><li><a href=#identity><code>_.identity</code></a><li><a href=#iteratee><code>_.iteratee</code></a><li><a href=#matches><code>_.matches</code></a><li><a href=#matchesProperty><code>_.matchesProperty</code></a><li><a href=#method><code>_.method</code></a><li><a href=#methodOf><code>_.methodOf</code></a><li><a href=#mixin><code>_.mixin</code></a><li><a href=#noConflict><code>_.noConflict</code></a><li><a href=#noop><code>_.noop</code></a><li><a href=#nthArg><code>_.nthArg</code></a><li><a href=#over><code>_.over</code></a><li><a href=#overEvery><code>_.overEvery</code></a><li><a href=#overSome><code>_.overSome</code></a><li><a href=#property><code>_.property</code></a><li><a href=#propertyOf><code>_.propertyOf</code></a><li><a href=#range><code>_.range</code></a><li><a href=#rangeRight><code>_.rangeRight</code></a><li><a href=#runInContext><code>_.runInContext</code></a><li><a href=#stubArray><code>_.stubArray</code></a><li><a href=#stubFalse><code>_.stubFalse</code></a><li><a href=#stubObject><code>_.stubObject</code></a><li><a href=#stubString><code>_.stubString</code></a><li><a href=#stubTrue><code>_.stubTrue</code></a><li><a href=#times><code>_.times</code></a><li><a href=#toPath><code>_.toPath</code></a><li><a href=#uniqueId><code>_.uniqueId</code></a></ul></div><div><h2><code>Properties</code></h2><ul><li><a href=#VERSION><code>_.VERSION</code></a><li><a href=#templateSettings><code>_.templateSettings</code></a><li><a href=#templateSettings-escape><code>_.templateSettings.escape</code></a><li><a href=#templateSettings-evaluate><code>_.templateSettings.evaluate</code></a><li><a href=#templateSettings-imports><code>_.templateSettings.imports</code></a><li><a href=#templateSettings-interpolate><code>_.templateSettings.interpolate</code></a><li><a href=#templateSettings-variable><code>_.templateSettings.variable</code></a></ul></div><div><h2><code>Methods</code></h2><ul><li><a href=#templateSettings-imports-_><code>_.templateSettings.imports._</code></a></ul></div></div><div class=doc-container><script src=/vendor/cdn.jsdelivr.net/lodash/4.17.2/lodash.min.js integrity=sha384-M/4X4ie0qEUsbFQjmkoTxVlnY9qRl7kx6E3qF1zd86oa3BAn1iPD8XGv0ijRwnbe crossorigin=anonymous></script><script src=https://embed.runkit.com/ integrity=sha384-AopOp5MNNAdV2kRPQgGlnI6noZ0Ii6sceGEQruBidfqu+QCMssJqKC0lej1ePFU9 crossorigin=anonymous></script><script src=/vendor/cdn.jsdelivr.net/g/fuse@2.5.0,immutable.js@3.8.1,react@15.3.2(react.min.js+react-dom.min.js) integrity=sha384-NFvWg391HUzxoyYtBHIFpwz8GQwmfhqOTtkoDntpx1pGfKmWfxwcNFPrjQbEXk9L crossorigin=anonymous></script><script src=/assets/js/docs.js></script><div><h2><code>“Array” Methods</code></h2><div><h3 id=chunk><a href=#chunk class="fa fa-link"></a><code>_.chunk(array, [size=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L6841>source</a> <a href=https://www.npmjs.com/package/lodash.chunk>npm package</a><p>Creates an array of elements split into groups the length of <code>size</code>. If <code>array</code> can't be split evenly, the final chunk will be the remaining elements.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to process.<li><code>[size=1]</code> <em>(number)</em>: The length of each chunk</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of chunks.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>chunk</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [['a', 'b'], ['c', 'd']]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>chunk</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>]<span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [['a', 'b', 'c'], ['d']]</span></div></pre></div></div><div><h3 id=compact><a href=#compact class="fa fa-link"></a><code>_.compact(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L6876>source</a> <a href=https://www.npmjs.com/package/lodash.compact>npm package</a><p>Creates an array with all falsey values removed. The values <code>false</code>, <code>null</code>, <code>0</code>, <code>""</code>, <code>undefined</code>, and <code>NaN</code> are falsey.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to compact.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class=delimiter>.</span><span class=support>compact</span>([<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> false<span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>''</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=concat><a href=#concat class="fa fa-link"></a><code>_.concat(array, [values])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L6913>source</a> <a href=https://www.npmjs.com/package/lodash.concat>npm package</a><p>Creates a new array concatenating <code>array</code> with any additional arrays and/or values.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to concatenate.<li><code>[values]</code> <em>(...*)</em>: The values to concatenate.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new concatenated array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span>];</div><div><span class=type>var</span> other = _<span class="delimiter method">.</span><span class=support>concat</span>(array<span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> [<span class=numeric>3</span>]<span class=delimiter>,</span> [[<span class=numeric>4</span>]]);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(other);</div><div><span class=comment>// => [1, 2, 3, [4]]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [1]</span></div></pre></div></div><div><h3 id=difference><a href=#difference class="fa fa-link"></a><code>_.difference(array, [values])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L6949>source</a> <a href=https://www.npmjs.com/package/lodash.difference>npm package</a><p>Creates an array of <code>array</code> values not included in the other given arrays using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons. The order and references of result values are determined by the first array.<br><br><strong>Note:</strong> Unlike <a href=#pullAll><code>_.pullAll</code></a>, this method returns a new array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[values]</code> <em>(...Array)</em>: The values to exclude.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>difference</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span>]<span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1]</span></div></pre></div></div><div><h3 id=differenceBy><a href=#differenceBy class="fa fa-link"></a><code>_.differenceBy(array, [values], [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L6981>source</a> <a href=https://www.npmjs.com/package/lodash.differenceby>npm package</a><p>This method is like <a href=#difference><code>_.difference</code></a> except that it accepts <code>iteratee</code> which is invoked for each element of <code>array</code> and <code>values</code> to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:<br><em>(value)</em>.<br><br><strong>Note:</strong> Unlike <a href=#pullAllBy><code>_.pullAllBy</code></a>, this method returns a new array.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[values]</code> <em>(...Array)</em>: The values to exclude.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>differenceBy</span>([<span class=numeric>2<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>1<span class=delimiter>.</span>2</span>]<span class=delimiter>,</span> [<span class=numeric>2<span class=delimiter>.</span>3</span><span class=delimiter>,</span> <span class=numeric>3<span class=delimiter>.</span>4</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [1.2]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>differenceBy</span>([{ <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => [{ 'x': 2 }]</span></div></pre></div></div><div><h3 id=differenceWith><a href=#differenceWith class="fa fa-link"></a><code>_.differenceWith(array, [values], [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7014>source</a> <a href=https://www.npmjs.com/package/lodash.differencewith>npm package</a><p>This method is like <a href=#difference><code>_.difference</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>array</code> to <code>values</code>. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<br><br><strong>Note:</strong> Unlike <a href=#pullAllWith><code>_.pullAllWith</code></a>, this method returns a new array.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[values]</code> <em>(...Array)</em>: The values to exclude.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>differenceWith</span>(objects<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }]<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class=comment>// => [{ 'x': 2, 'y': 1 }]</span></div></pre></div></div><div><h3 id=drop><a href=#drop class="fa fa-link"></a><code>_.drop(array, [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7049>source</a> <a href=https://www.npmjs.com/package/lodash.drop>npm package</a><p>Creates a slice of <code>array</code> with <code>n</code> elements dropped from the beginning.<h4>Since</h4><p>0.5.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[n=1]</code> <em>(number)</em>: The number of elements to drop.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>drop</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [2, 3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>drop</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>drop</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => []</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>drop</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=dropRight><a href=#dropRight class="fa fa-link"></a><code>_.dropRight(array, [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7083>source</a> <a href=https://www.npmjs.com/package/lodash.dropright>npm package</a><p>Creates a slice of <code>array</code> with <code>n</code> elements dropped from the end.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[n=1]</code> <em>(number)</em>: The number of elements to drop.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>dropRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>dropRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>dropRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => []</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>dropRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=dropRightWhile><a href=#dropRightWhile class="fa fa-link"></a><code>_.dropRightWhile(array, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7128>source</a> <a href=https://www.npmjs.com/package/lodash.droprightwhile>npm package</a><p>Creates a slice of <code>array</code> excluding elements dropped from the end. Elements are dropped until <code>predicate</code> returns falsey. The predicate is invoked with three arguments: <em>(value, index, array)</em>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>dropRightWhile</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['barney']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropRightWhile</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => objects for ['barney', 'fred']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropRightWhile</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['barney']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropRightWhile</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => objects for ['barney', 'fred', 'pebbles']</span></div></pre></div></div><div><h3 id=dropWhile><a href=#dropWhile class="fa fa-link"></a><code>_.dropWhile(array, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7169>source</a> <a href=https://www.npmjs.com/package/lodash.dropwhile>npm package</a><p>Creates a slice of <code>array</code> excluding elements dropped from the beginning. Elements are dropped until <code>predicate</code> returns falsey. The predicate is invoked with three arguments: <em>(value, index, array)</em>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>dropWhile</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['pebbles']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropWhile</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => objects for ['fred', 'pebbles']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropWhile</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['pebbles']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>dropWhile</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => objects for ['barney', 'fred', 'pebbles']</span></div></pre></div></div><div><h3 id=fill><a href=#fill class="fa fa-link"></a><code>_.fill(array, value, [start=0], [end=array.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7204>source</a> <a href=https://www.npmjs.com/package/lodash.fill>npm package</a><p>Fills elements of <code>array</code> with <code>value</code> from <code>start</code> up to, but not including, <code>end</code>.<br><br><strong>Note:</strong> This method mutates <code>array</code>.<h4>Since</h4><p>3.2.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to fill.<li><code>value</code> <em>(*)</em>: The value to fill <code>array</code> with.<li><code>[start=0]</code> <em>(number)</em>: The start position.<li><code>[end=array.length]</code> <em>(number)</em>: The end position.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>fill</span>(array<span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => ['a', 'a', 'a']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>fill</span>(<span class=support>Array</span>(<span class=numeric>3</span>)<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [2, 2, 2]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>fill</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>6</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=numeric>10</span>]<span class=delimiter>,</span> <span class=string>'*'</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [4, '*', '*', 10]</span></div></pre></div></div><div><h3 id=findIndex><a href=#findIndex class="fa fa-link"></a><code>_.findIndex(array, [predicate=_.identity], [fromIndex=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7251>source</a> <a href=https://www.npmjs.com/package/lodash.findindex>npm package</a><p>This method is like <a href=#find><code>_.find</code></a> except that it returns the index of the first element <code>predicate</code> returns truthy for instead of the element itself.<h4>Since</h4><p>1.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[fromIndex=0]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the found element, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>findIndex</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>user == <span class=string>'barney'</span>; });</div><div><span class=comment>// => 0</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findIndex</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => 1</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findIndex</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => 0</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findIndex</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => 2</span></div></pre></div></div><div><h3 id=findLastIndex><a href=#findLastIndex class="fa fa-link"></a><code>_.findLastIndex(array, [predicate=_.identity], [fromIndex=array.length-1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7298>source</a> <a href=https://www.npmjs.com/package/lodash.findlastindex>npm package</a><p>This method is like <a href=#findIndex><code>_.findIndex</code></a> except that it iterates over elements of <code>collection</code> from right to left.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[fromIndex=array.length-1]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the found element, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>findLastIndex</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>user == <span class=string>'pebbles'</span>; });</div><div><span class=comment>// => 2</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastIndex</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => 0</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastIndex</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => 2</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastIndex</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => 0</span></div></pre></div></div><div><h3 id=flatten><a href=#flatten class="fa fa-link"></a><code>_.flatten(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7327>source</a> <a href=https://www.npmjs.com/package/lodash.flatten>npm package</a><p>Flattens <code>array</code> a single level deep.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to flatten.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>flatten</span>([<span class=numeric>1</span><span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> [<span class=numeric>3</span><span class=delimiter>,</span> [<span class=numeric>4</span>]]<span class=delimiter>,</span> <span class=numeric>5</span>]]);</div><div><span class=comment>// => [1, 2, [3, [4]], 5]</span></div></pre></div></div><div><h3 id=flattenDeep><a href=#flattenDeep class="fa fa-link"></a><code>_.flattenDeep(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7346>source</a> <a href=https://www.npmjs.com/package/lodash.flattendeep>npm package</a><p>Recursively flattens <code>array</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to flatten.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>flattenDeep</span>([<span class=numeric>1</span><span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> [<span class=numeric>3</span><span class=delimiter>,</span> [<span class=numeric>4</span>]]<span class=delimiter>,</span> <span class=numeric>5</span>]]);</div><div><span class=comment>// => [1, 2, 3, 4, 5]</span></div></pre></div></div><div><h3 id=flattenDepth><a href=#flattenDepth class="fa fa-link"></a><code>_.flattenDepth(array, [depth=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7371>source</a> <a href=https://www.npmjs.com/package/lodash.flattendepth>npm package</a><p>Recursively flatten <code>array</code> up to <code>depth</code> times.<h4>Since</h4><p>4.4.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to flatten.<li><code>[depth=1]</code> <em>(number)</em>: The maximum recursion depth.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> [<span class=numeric>3</span><span class=delimiter>,</span> [<span class=numeric>4</span>]]<span class=delimiter>,</span> <span class=numeric>5</span>]];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>flattenDepth</span>(array<span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => [1, 2, [3, [4]], 5]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>flattenDepth</span>(array<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [1, 2, 3, [4], 5]</span></div></pre></div></div><div><h3 id=fromPairs><a href=#fromPairs class="fa fa-link"></a><code>_.fromPairs(pairs)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7395>source</a> <a href=https://www.npmjs.com/package/lodash.frompairs>npm package</a><p>The inverse of <a href=#toPairs><code>_.toPairs</code></a>; this method returns an object composed from key-value <code>pairs</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>pairs</code> <em>(Array)</em>: The key-value pairs.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>fromPairs</span>([[<span class=string>'a'</span><span class=delimiter>,</span> <span class=numeric>1</span>]<span class=delimiter>,</span> [<span class=string>'b'</span><span class=delimiter>,</span> <span class=numeric>2</span>]]);</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div></pre></div></div><div><h3 id=head><a href=#head class="fa fa-link"></a><code>_.head(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7425>source</a> <a href=https://www.npmjs.com/package/lodash.head>npm package</a><p>Gets the first element of <code>array</code>.<h4>Since</h4><p>0.1.0<h4>Aliases</h4><p><em>_.first</em><h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the first element of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>head</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => 1</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>head</span>([]);</div><div><span class=comment>// => undefined</span></div></pre></div></div><div><h3 id=indexOf><a href=#indexOf class="fa fa-link"></a><code>_.indexOf(array, value, [fromIndex=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7452>source</a> <a href=https://www.npmjs.com/package/lodash.indexof>npm package</a><p>Gets the index at which the first occurrence of <code>value</code> is found in <code>array</code> using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons. If <code>fromIndex</code> is negative, it's used as the offset from the end of <code>array</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>value</code> <em>(*)</em>: The value to search for.<li><code>[fromIndex=0]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the matched value, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>indexOf</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 1</span></div><div> </div><div><span class=comment>// Search from the `fromIndex`.</span></div><div>_<span class="delimiter method">.</span><span class=support>indexOf</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=initial><a href=#initial class="fa fa-link"></a><code>_.initial(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7478>source</a> <a href=https://www.npmjs.com/package/lodash.initial>npm package</a><p>Gets all but the last element of <code>array</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>initial</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1, 2]</span></div></pre></div></div><div><h3 id=intersection><a href=#intersection class="fa fa-link"></a><code>_.intersection([arrays])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7500>source</a> <a href=https://www.npmjs.com/package/lodash.intersection>npm package</a><p>Creates an array of unique values that are included in all given arrays using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons. The order and references of result values are determined by the first array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of intersecting values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>intersection</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span>]<span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [2]</span></div></pre></div></div><div><h3 id=intersectionBy><a href=#intersectionBy class="fa fa-link"></a><code>_.intersectionBy([arrays], [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7530>source</a> <a href=https://www.npmjs.com/package/lodash.intersectionby>npm package</a><p>This method is like <a href=#intersection><code>_.intersection</code></a> except that it accepts <code>iteratee</code> which is invoked for each element of each <code>arrays</code> to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:<br><em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of intersecting values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>intersectionBy</span>([<span class=numeric>2<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>1<span class=delimiter>.</span>2</span>]<span class=delimiter>,</span> [<span class=numeric>2<span class=delimiter>.</span>3</span><span class=delimiter>,</span> <span class=numeric>3<span class=delimiter>.</span>4</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [2.1]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>intersectionBy</span>([{ <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => [{ 'x': 1 }]</span></div></pre></div></div><div><h3 id=intersectionWith><a href=#intersectionWith class="fa fa-link"></a><code>_.intersectionWith([arrays], [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7565>source</a> <a href=https://www.npmjs.com/package/lodash.intersectionwith>npm package</a><p>This method is like <a href=#intersection><code>_.intersection</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>arrays</code>. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of intersecting values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }];</div><div><span class=type>var</span> others = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>intersectionWith</span>(objects<span class=delimiter>,</span> others<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class=comment>// => [{ 'x': 1, 'y': 2 }]</span></div></pre></div></div><div><h3 id=join><a href=#join class="fa fa-link"></a><code>_.join(array, [separator=','])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7593>source</a> <a href=https://www.npmjs.com/package/lodash.join>npm package</a><p>Converts all elements in <code>array</code> into a string separated by <code>separator</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to convert.<li><code>[separator=',']</code> <em>(string)</em>: The element separator.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the joined string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>join</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span>]<span class=delimiter>,</span> <span class=string>'~'</span>);</div><div><span class=comment>// => 'a~b~c'</span></div></pre></div></div><div><h3 id=last><a href=#last class="fa fa-link"></a><code>_.last(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7611>source</a> <a href=https://www.npmjs.com/package/lodash.last>npm package</a><p>Gets the last element of <code>array</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the last element of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>last</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=lastIndexOf><a href=#lastIndexOf class="fa fa-link"></a><code>_.lastIndexOf(array, value, [fromIndex=array.length-1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7637>source</a> <a href=https://www.npmjs.com/package/lodash.lastindexof>npm package</a><p>This method is like <a href=#indexOf><code>_.indexOf</code></a> except that it iterates over elements of <code>array</code> from right to left.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>value</code> <em>(*)</em>: The value to search for.<li><code>[fromIndex=array.length-1]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the matched value, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>lastIndexOf</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div><span class=comment>// Search from the `fromIndex`.</span></div><div>_<span class="delimiter method">.</span><span class=support>lastIndexOf</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 1</span></div></pre></div></div><div><h3 id=nth><a href=#nth class="fa fa-link"></a><code>_.nth(array, [n=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7673>source</a> <a href=https://www.npmjs.com/package/lodash.nth>npm package</a><p>Gets the element at index <code>n</code> of <code>array</code>. If <code>n</code> is negative, the nth element from the end is returned.<h4>Since</h4><p>4.11.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[n=0]</code> <em>(number)</em>: The index of the element to return.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the nth element of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>nth</span>(array<span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => 'b'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>nth</span>(array<span class=delimiter>,</span> -<span class=numeric>2</span>);</div><div><span class=comment>// => 'c';</span></div></pre></div></div><div><h3 id=pull><a href=#pull class="fa fa-link"></a><code>_.pull(array, [values])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7700>source</a> <a href=https://www.npmjs.com/package/lodash.pull>npm package</a><p>Removes all given values from <code>array</code> using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons.<br><br><strong>Note:</strong> Unlike <a href=#without><code>_.without</code></a>, this method mutates <code>array</code>. Use <a href=#remove><code>_.remove</code></a> to remove elements from an array by predicate.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>[values]</code> <em>(...*)</em>: The values to remove.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pull</span>(array<span class=delimiter>,</span> <span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'c'</span>);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => ['b', 'b']</span></div></pre></div></div><div><h3 id=pullAll><a href=#pullAll class="fa fa-link"></a><code>_.pullAll(array, values)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7722>source</a> <a href=https://www.npmjs.com/package/lodash.pullall>npm package</a><p>This method is like <a href=#pull><code>_.pull</code></a> except that it accepts an array of values to remove.<br><br><strong>Note:</strong> Unlike <a href=#difference><code>_.difference</code></a>, this method mutates <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>values</code> <em>(Array)</em>: The values to remove.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pullAll</span>(array<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'c'</span>]);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => ['b', 'b']</span></div></pre></div></div><div><h3 id=pullAllBy><a href=#pullAllBy class="fa fa-link"></a><code>_.pullAllBy(array, values, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7751>source</a> <a href=https://www.npmjs.com/package/lodash.pullallby>npm package</a><p>This method is like <a href=#pullAll><code>_.pullAll</code></a> except that it accepts <code>iteratee</code> which is invoked for each element of <code>array</code> and <code>values</code> to generate the criterion by which they're compared. The iteratee is invoked with one argument: <em>(value)</em>.<br><br><strong>Note:</strong> Unlike <a href=#differenceBy><code>_.differenceBy</code></a>, this method mutates <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>values</code> <em>(Array)</em>: The values to remove.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [{ <span class=string>'x'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>3</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pullAllBy</span>(array<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>3</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [{ 'x': 2 }]</span></div></pre></div></div><div><h3 id=pullAllWith><a href=#pullAllWith class="fa fa-link"></a><code>_.pullAllWith(array, values, [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7780>source</a> <a href=https://www.npmjs.com/package/lodash.pullallwith>npm package</a><p>This method is like <a href=#pullAll><code>_.pullAll</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>array</code> to <code>values</code>. The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<br><br><strong>Note:</strong> Unlike <a href=#differenceWith><code>_.differenceWith</code></a>, this method mutates <code>array</code>.<h4>Since</h4><p>4.6.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>values</code> <em>(Array)</em>: The values to remove.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>3</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>5</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>6</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pullAllWith</span>(array<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>3</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>4</span> }]<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]</span></div></pre></div></div><div><h3 id=pullAt><a href=#pullAt class="fa fa-link"></a><code>_.pullAt(array, [indexes])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7810>source</a> <a href=https://www.npmjs.com/package/lodash.pullat>npm package</a><p>Removes elements from <code>array</code> corresponding to <code>indexes</code> and returns an array of removed elements.<br><br><strong>Note:</strong> Unlike <a href=#at><code>_.at</code></a>, this method mutates <code>array</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>[indexes]</code> <em>(...(number|number[]))</em>: The indexes of elements to remove.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of removed elements.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>];</div><div><span class=type>var</span> pulled = _<span class="delimiter method">.</span><span class=name>pullAt</span>(array<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => ['a', 'c']</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(pulled);</div><div><span class=comment>// => ['b', 'd']</span></div></pre></div></div><div><h3 id=remove><a href=#remove class="fa fa-link"></a><code>_.remove(array, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7849>source</a> <a href=https://www.npmjs.com/package/lodash.remove>npm package</a><p>Removes all elements from <code>array</code> that <code>predicate</code> returns truthy for and returns an array of the removed elements. The predicate is invoked with three arguments: <em>(value, index, array)</em>.<br><br><strong>Note:</strong> Unlike <a href=#filter><code>_.filter</code></a>, this method mutates <code>array</code>. Use <a href=#pull><code>_.pull</code></a> to pull elements from an array by value.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of removed elements.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>];</div><div><span class=type>var</span> evens = _<span class="delimiter method">.</span><span class=name>remove</span>(array<span class=delimiter>,</span> <span class=type>function</span>(n) {</div><div>  return n % <span class=numeric>2</span> == <span class=numeric>0</span>;</div><div>});</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [1, 3]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(evens);</div><div><span class=comment>// => [2, 4]</span></div></pre></div></div><div><h3 id=reverse><a href=#reverse class="fa fa-link"></a><code>_.reverse(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7893>source</a> <a href=https://www.npmjs.com/package/lodash.reverse>npm package</a><p>Reverses <code>array</code> so that the first element becomes the last, the second element becomes the second to last, and so on.<br><br><strong>Note:</strong> This method mutates <code>array</code> and is based on <a href=https://mdn.io/Array/reverse><code>Array#reverse</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to modify.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=support>reverse</span>(array);</div><div><span class=comment>// => [3, 2, 1]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [3, 2, 1]</span></div></pre></div></div><div><h3 id=slice><a href=#slice class="fa fa-link"></a><code>_.slice(array, [start=0], [end=array.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7913>source</a> <a href=https://www.npmjs.com/package/lodash.slice>npm package</a><p>Creates a slice of <code>array</code> from <code>start</code> up to, but not including, <code>end</code>.<br><br><strong>Note:</strong> This method is used instead of <a href=https://mdn.io/Array/slice><code>Array#slice</code></a> to ensure dense arrays are returned.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to slice.<li><code>[start=0]</code> <em>(number)</em>: The start position.<li><code>[end=array.length]</code> <em>(number)</em>: The end position.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.</div><div><h3 id=sortedIndex><a href=#sortedIndex class="fa fa-link"></a><code>_.sortedIndex(array, value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7946>source</a> <a href=https://www.npmjs.com/package/lodash.sortedindex>npm package</a><p>Uses a binary search to determine the lowest index at which <code>value</code> should be inserted into <code>array</code> in order to maintain its sort order.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The sorted array to inspect.<li><code>value</code> <em>(*)</em>: The value to evaluate.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index at which <code>value</code> should be inserted into <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedIndex</span>([<span class=numeric>30</span><span class=delimiter>,</span> <span class=numeric>50</span>]<span class=delimiter>,</span> <span class=numeric>40</span>);</div><div><span class=comment>// => 1</span></div></pre></div></div><div><h3 id=sortedIndexBy><a href=#sortedIndexBy class="fa fa-link"></a><code>_.sortedIndexBy(array, value, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7975>source</a> <a href=https://www.npmjs.com/package/lodash.sortedindexby>npm package</a><p>This method is like <a href=#sortedIndex><code>_.sortedIndex</code></a> except that it accepts <code>iteratee</code> which is invoked for <code>value</code> and each element of <code>array</code> to compute their sort ranking. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The sorted array to inspect.<li><code>value</code> <em>(*)</em>: The value to evaluate.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index at which <code>value</code> should be inserted into <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>5</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sortedIndexBy</span>(objects<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span><span class=support>x</span>; });</div><div><span class=comment>// => 0</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>sortedIndexBy</span>(objects<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => 0</span></div></pre></div></div><div><h3 id=sortedIndexOf><a href=#sortedIndexOf class="fa fa-link"></a><code>_.sortedIndexOf(array, value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L7995>source</a> <a href=https://www.npmjs.com/package/lodash.sortedindexof>npm package</a><p>This method is like <a href=#indexOf><code>_.indexOf</code></a> except that it performs a binary search on a sorted <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>value</code> <em>(*)</em>: The value to search for.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the matched value, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedIndexOf</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>6</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => 1</span></div></pre></div></div><div><h3 id=sortedLastIndex><a href=#sortedLastIndex class="fa fa-link"></a><code>_.sortedLastIndex(array, value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8024>source</a> <a href=https://www.npmjs.com/package/lodash.sortedlastindex>npm package</a><p>This method is like <a href=#sortedIndex><code>_.sortedIndex</code></a> except that it returns the highest index at which <code>value</code> should be inserted into <code>array</code> in order to maintain its sort order.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The sorted array to inspect.<li><code>value</code> <em>(*)</em>: The value to evaluate.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index at which <code>value</code> should be inserted into <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedLastIndex</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>6</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => 4</span></div></pre></div></div><div><h3 id=sortedLastIndexBy><a href=#sortedLastIndexBy class="fa fa-link"></a><code>_.sortedLastIndexBy(array, value, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8053>source</a> <a href=https://www.npmjs.com/package/lodash.sortedlastindexby>npm package</a><p>This method is like <a href=#sortedLastIndex><code>_.sortedLastIndex</code></a> except that it accepts <code>iteratee</code> which is invoked for <code>value</code> and each element of <code>array</code> to compute their sort ranking. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The sorted array to inspect.<li><code>value</code> <em>(*)</em>: The value to evaluate.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index at which <code>value</code> should be inserted into <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>5</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sortedLastIndexBy</span>(objects<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span><span class=support>x</span>; });</div><div><span class=comment>// => 1</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>sortedLastIndexBy</span>(objects<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => 1</span></div></pre></div></div><div><h3 id=sortedLastIndexOf><a href=#sortedLastIndexOf class="fa fa-link"></a><code>_.sortedLastIndexOf(array, value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8073>source</a> <a href=https://www.npmjs.com/package/lodash.sortedlastindexof>npm package</a><p>This method is like <a href=#lastIndexOf><code>_.lastIndexOf</code></a> except that it performs a binary search on a sorted <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>value</code> <em>(*)</em>: The value to search for.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the index of the matched value, else <code>-1</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedLastIndexOf</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>6</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=sortedUniq><a href=#sortedUniq class="fa fa-link"></a><code>_.sortedUniq(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8099>source</a> <a href=https://www.npmjs.com/package/lodash.sorteduniq>npm package</a><p>This method is like <a href=#uniq><code>_.uniq</code></a> except that it's designed and optimized for sorted arrays.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new duplicate free array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedUniq</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div><span class=comment>// => [1, 2]</span></div></pre></div></div><div><h3 id=sortedUniqBy><a href=#sortedUniqBy class="fa fa-link"></a><code>_.sortedUniqBy(array, [iteratee])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8121>source</a> <a href=https://www.npmjs.com/package/lodash.sorteduniqby>npm package</a><p>This method is like <a href=#uniqBy><code>_.uniqBy</code></a> except that it's designed and optimized for sorted arrays.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[iteratee]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new duplicate free array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sortedUniqBy</span>([<span class=numeric>1<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>1<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>2<span class=delimiter>.</span>3</span><span class=delimiter>,</span> <span class=numeric>2<span class=delimiter>.</span>4</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [1.1, 2.3]</span></div></pre></div></div><div><h3 id=tail><a href=#tail class="fa fa-link"></a><code>_.tail(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8141>source</a> <a href=https://www.npmjs.com/package/lodash.tail>npm package</a><p>Gets all but the first element of <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>tail</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [2, 3]</span></div></pre></div></div><div><h3 id=take><a href=#take class="fa fa-link"></a><code>_.take(array, [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8171>source</a> <a href=https://www.npmjs.com/package/lodash.take>npm package</a><p>Creates a slice of <code>array</code> with <code>n</code> elements taken from the beginning.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[n=1]</code> <em>(number)</em>: The number of elements to take.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>take</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>take</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>take</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>take</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=takeRight><a href=#takeRight class="fa fa-link"></a><code>_.takeRight(array, [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8204>source</a> <a href=https://www.npmjs.com/package/lodash.takeright>npm package</a><p>Creates a slice of <code>array</code> with <code>n</code> elements taken from the end.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[n=1]</code> <em>(number)</em>: The number of elements to take.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>takeRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>takeRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [2, 3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>takeRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>takeRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=takeRightWhile><a href=#takeRightWhile class="fa fa-link"></a><code>_.takeRightWhile(array, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8249>source</a> <a href=https://www.npmjs.com/package/lodash.takerightwhile>npm package</a><p>Creates a slice of <code>array</code> with elements taken from the end. Elements are taken until <code>predicate</code> returns falsey. The predicate is invoked with three arguments: <em>(value, index, array)</em>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>takeRightWhile</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['fred', 'pebbles']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeRightWhile</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => objects for ['pebbles']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeRightWhile</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['fred', 'pebbles']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeRightWhile</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=takeWhile><a href=#takeWhile class="fa fa-link"></a><code>_.takeWhile(array, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8290>source</a> <a href=https://www.npmjs.com/package/lodash.takewhile>npm package</a><p>Creates a slice of <code>array</code> with elements taken from the beginning. Elements are taken until <code>predicate</code> returns falsey. The predicate is invoked with three arguments: <em>(value, index, array)</em>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to query.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the slice of <code>array</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'active'</span>: false}<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>takeWhile</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['barney', 'fred']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeWhile</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => objects for ['barney']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeWhile</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['barney', 'fred']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>takeWhile</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=union><a href=#union class="fa fa-link"></a><code>_.union([arrays])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8312>source</a> <a href=https://www.npmjs.com/package/lodash.union>npm package</a><p>Creates an array of unique values, in order, from all given arrays using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of combined values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>union</span>([<span class=numeric>2</span>]<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div><span class=comment>// => [2, 1]</span></div></pre></div></div><div><h3 id=unionBy><a href=#unionBy class="fa fa-link"></a><code>_.unionBy([arrays], [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8339>source</a> <a href=https://www.npmjs.com/package/lodash.unionby>npm package</a><p>This method is like <a href=#union><code>_.union</code></a> except that it accepts <code>iteratee</code> which is invoked for each element of each <code>arrays</code> to generate the criterion by which uniqueness is computed. Result values are chosen from the first array in which the value occurs. The iteratee is invoked with one argument:<br><em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of combined values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>unionBy</span>([<span class=numeric>2<span class=delimiter>.</span>1</span>]<span class=delimiter>,</span> [<span class=numeric>1<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>2<span class=delimiter>.</span>3</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [2.1, 1.2]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>unionBy</span>([{ <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => [{ 'x': 1 }, { 'x': 2 }]</span></div></pre></div></div><div><h3 id=unionWith><a href=#unionWith class="fa fa-link"></a><code>_.unionWith([arrays], [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8368>source</a> <a href=https://www.npmjs.com/package/lodash.unionwith>npm package</a><p>This method is like <a href=#union><code>_.union</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>arrays</code>. Result values are chosen from the first array in which the value occurs. The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of combined values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }];</div><div><span class=type>var</span> others = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>unionWith</span>(objects<span class=delimiter>,</span> others<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class=comment>// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]</span></div></pre></div></div><div><h3 id=uniq><a href=#uniq class="fa fa-link"></a><code>_.uniq(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8392>source</a> <a href=https://www.npmjs.com/package/lodash.uniq>npm package</a><p>Creates a duplicate-free version of an array, using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new duplicate free array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>uniq</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div><span class=comment>// => [2, 1]</span></div></pre></div></div><div><h3 id=uniqBy><a href=#uniqBy class="fa fa-link"></a><code>_.uniqBy(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8419>source</a> <a href=https://www.npmjs.com/package/lodash.uniqby>npm package</a><p>This method is like <a href=#uniq><code>_.uniq</code></a> except that it accepts <code>iteratee</code> which is invoked for each element in <code>array</code> to generate the criterion by which uniqueness is computed. The order of result values is determined by the order they occur in the array. The iteratee is invoked with one argument:<br><em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new duplicate free array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>uniqBy</span>([<span class=numeric>2<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>1<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>2<span class=delimiter>.</span>3</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [2.1, 1.2]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>uniqBy</span>([{ <span class=string>'x'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => [{ 'x': 1 }, { 'x': 2 }]</span></div></pre></div></div><div><h3 id=uniqWith><a href=#uniqWith class="fa fa-link"></a><code>_.uniqWith(array, [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8443>source</a> <a href=https://www.npmjs.com/package/lodash.uniqwith>npm package</a><p>This method is like <a href=#uniq><code>_.uniq</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>array</code>. The order of result values is determined by the order they occur in the array.The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new duplicate free array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>uniqWith</span>(objects<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class=comment>// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]</span></div></pre></div></div><div><h3 id=unzip><a href=#unzip class="fa fa-link"></a><code>_.unzip(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8467>source</a> <a href=https://www.npmjs.com/package/lodash.unzip>npm package</a><p>This method is like <a href=#zip><code>_.zip</code></a> except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip configuration.<h4>Since</h4><p>1.2.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array of grouped elements to process.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of regrouped elements.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> zipped = _<span class="delimiter method">.</span><span class=name>zip</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> [true<span class=delimiter>,</span> false]);</div><div><span class=comment>// => [['a', 1, true], ['b', 2, false]]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>unzip</span>(zipped);</div><div><span class=comment>// => [['a', 'b'], [1, 2], [true, false]]</span></div></pre></div></div><div><h3 id=unzipWith><a href=#unzipWith class="fa fa-link"></a><code>_.unzipWith(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8504>source</a> <a href=https://www.npmjs.com/package/lodash.unzipwith>npm package</a><p>This method is like <a href=#unzip><code>_.unzip</code></a> except that it accepts <code>iteratee</code> to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group: <em>(...group)</em>.<h4>Since</h4><p>3.8.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array of grouped elements to process.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function to combine regrouped values.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of regrouped elements.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> zipped = _<span class="delimiter method">.</span><span class=name>zip</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> [<span class=numeric>10</span><span class=delimiter>,</span> <span class=numeric>20</span>]<span class=delimiter>,</span> [<span class=numeric>100</span><span class=delimiter>,</span> <span class=numeric>200</span>]);</div><div><span class=comment>// => [[1, 10, 100], [2, 20, 200]]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>unzipWith</span>(zipped<span class=delimiter>,</span> _<span class=delimiter>.</span>add);</div><div><span class=comment>// => [3, 30, 300]</span></div></pre></div></div><div><h3 id=without><a href=#without class="fa fa-link"></a><code>_.without(array, [values])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8537>source</a> <a href=https://www.npmjs.com/package/lodash.without>npm package</a><p>Creates an array excluding all given values using <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> for equality comparisons.<br><br><strong>Note:</strong> Unlike <a href=#pull><code>_.pull</code></a>, this method returns a new array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to inspect.<li><code>[values]</code> <em>(...*)</em>: The values to exclude.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>without</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [3]</span></div></pre></div></div><div><h3 id=xor><a href=#xor class="fa fa-link"></a><code>_.xor([arrays])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8561>source</a> <a href=https://www.npmjs.com/package/lodash.xor>npm package</a><p>Creates an array of unique values that is the <a href=https://en.wikipedia.org/wiki/Symmetric_difference>symmetric difference</a> of the given arrays. The order of result values is determined by the order they occur in the arrays.<h4>Since</h4><p>2.4.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>xor</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span>]<span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => [1, 3]</span></div></pre></div></div><div><h3 id=xorBy><a href=#xorBy class="fa fa-link"></a><code>_.xorBy([arrays], [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8588>source</a> <a href=https://www.npmjs.com/package/lodash.xorby>npm package</a><p>This method is like <a href=#xor><code>_.xor</code></a> except that it accepts <code>iteratee</code> which is invoked for each element of each <code>arrays</code> to generate the criterion by which by which they're compared. The order of result values is determined by the order they occur in the arrays. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>xorBy</span>([<span class=numeric>2<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>1<span class=delimiter>.</span>2</span>]<span class=delimiter>,</span> [<span class=numeric>2<span class=delimiter>.</span>3</span><span class=delimiter>,</span> <span class=numeric>3<span class=delimiter>.</span>4</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => [1.2, 3.4]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>xorBy</span>([{ <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> [{ <span class=string>'x'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span> }]<span class=delimiter>,</span> <span class=string>'x'</span>);</div><div><span class=comment>// => [{ 'x': 2 }]</span></div></pre></div></div><div><h3 id=xorWith><a href=#xorWith class="fa fa-link"></a><code>_.xorWith([arrays], [comparator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8617>source</a> <a href=https://www.npmjs.com/package/lodash.xorwith>npm package</a><p>This method is like <a href=#xor><code>_.xor</code></a> except that it accepts <code>comparator</code> which is invoked to compare elements of <code>arrays</code>. The order of result values is determined by the order they occur in the arrays. The comparator is invoked with two arguments: <em>(arrVal, othVal)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to inspect.<li><code>[comparator]</code> <em>(Function)</em>: The comparator invoked per element.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of filtered values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }];</div><div><span class=type>var</span> others = [{ <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'x'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>xorWith</span>(objects<span class=delimiter>,</span> others<span class=delimiter>,</span> _<span class=delimiter>.</span>isEqual);</div><div><span class=comment>// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]</span></div></pre></div></div><div><h3 id=zip><a href=#zip class="fa fa-link"></a><code>_.zip([arrays])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8639>source</a> <a href=https://www.npmjs.com/package/lodash.zip>npm package</a><p>Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to process.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of grouped elements.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>zip</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> [true<span class=delimiter>,</span> false]);</div><div><span class=comment>// => [['a', 1, true], ['b', 2, false]]</span></div></pre></div></div><div><h3 id=zipObject><a href=#zipObject class="fa fa-link"></a><code>_.zipObject([props=[]], [values=[]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8657>source</a> <a href=https://www.npmjs.com/package/lodash.zipobject>npm package</a><p>This method is like <a href=#fromPairs><code>_.fromPairs</code></a> except that it accepts two arrays, one of property identifiers and one of corresponding values.<h4>Since</h4><p>0.4.0<h4>Arguments</h4><ol><li><code>[props=[]]</code> <em>(Array)</em>: The property identifiers.<li><code>[values=[]]</code> <em>(Array)</em>: The property values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>zipObject</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div></pre></div></div><div><h3 id=zipObjectDeep><a href=#zipObjectDeep class="fa fa-link"></a><code>_.zipObjectDeep([props=[]], [values=[]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8676>source</a> <a href=https://www.npmjs.com/package/lodash.zipobjectdeep>npm package</a><p>This method is like <a href=#zipObject><code>_.zipObject</code></a> except that it supports property paths.<h4>Since</h4><p>4.1.0<h4>Arguments</h4><ol><li><code>[props=[]]</code> <em>(Array)</em>: The property identifiers.<li><code>[values=[]]</code> <em>(Array)</em>: The property values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>zipObjectDeep</span>([<span class=string>'a.b[0].c'</span><span class=delimiter>,</span> <span class=string>'a.b[1].d'</span>]<span class=delimiter>,</span> [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div><span class=comment>// => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }</span></div></pre></div></div><div><h3 id=zipWith><a href=#zipWith class="fa fa-link"></a><code>_.zipWith([arrays], [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8700>source</a> <a href=https://www.npmjs.com/package/lodash.zipwith>npm package</a><p>This method is like <a href=#zip><code>_.zip</code></a> except that it accepts <code>iteratee</code> to specify how grouped values should be combined. The iteratee is invoked with the elements of each group: <em>(...group)</em>.<h4>Since</h4><p>3.8.0<h4>Arguments</h4><ol><li><code>[arrays]</code> <em>(...Array)</em>: The arrays to process.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function to combine grouped values.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new array of grouped elements.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>zipWith</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> [<span class=numeric>10</span><span class=delimiter>,</span> <span class=numeric>20</span>]<span class=delimiter>,</span> [<span class=numeric>100</span><span class=delimiter>,</span> <span class=numeric>200</span>]<span class=delimiter>,</span> <span class=type>function</span>(a<span class=delimiter>,</span> b<span class=delimiter>,</span> c) {</div><div>  return a + b + c;</div><div>});</div><div><span class=comment>// => [111, 222]</span></div></pre></div></div></div><div><h2><code>“Collection” Methods</code></h2><div><h3 id=countBy><a href=#countBy class="fa fa-link"></a><code>_.countBy(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9079>source</a> <a href=https://www.npmjs.com/package/lodash.countby>npm package</a><p>Creates an object composed of keys generated from the results of running each element of <code>collection</code> thru <code>iteratee</code>. The corresponding value of each key is the number of times the key was returned by <code>iteratee</code>. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>0.5.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee to transform keys.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the composed aggregate object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>countBy</span>([<span class=numeric>6<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>4<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>6<span class=delimiter>.</span>3</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => { '4': 1, '6': 2 }</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>countBy</span>([<span class=string>'one'</span><span class=delimiter>,</span> <span class=string>'two'</span><span class=delimiter>,</span> <span class=string>'three'</span>]<span class=delimiter>,</span> <span class=string>'length'</span>);</div><div><span class=comment>// => { '3': 2, '5': 1 }</span></div></pre></div></div><div><h3 id=every><a href=#every class="fa fa-link"></a><code>_.every(collection, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9128>source</a> <a href=https://www.npmjs.com/package/lodash.every>npm package</a><p>Checks if <code>predicate</code> returns truthy for <strong>all</strong> elements of <code>collection</code>. Iteration is stopped once <code>predicate</code> returns falsey. The predicate is invoked with three arguments: <em>(value, index|key, collection)</em>.<br><br><strong>Note:</strong> This method returns <code>true</code> for <a href=https://en.wikipedia.org/wiki/Empty_set>empty collections</a> because <a href=https://en.wikipedia.org/wiki/Vacuous_truth>everything is true</a> of elements of empty collections.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if all elements pass the predicate check, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>every</span>([true<span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> null<span class=delimiter>,</span> <span class=string>'yes'</span>]<span class=delimiter>,</span> <span class=support>Boolean</span>);</div><div><span class=comment>// => false</span></div><div> </div><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>every</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => false</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>every</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>every</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=filter><a href=#filter class="fa fa-link"></a><code>_.filter(collection, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9173>source</a> <a href=https://www.npmjs.com/package/lodash.filter>npm package</a><p>Iterates over elements of <code>collection</code>, returning an array of all elements <code>predicate</code> returns truthy for. The predicate is invoked with three arguments: <em>(value, index|key, collection)</em>.<br><br><strong>Note:</strong> Unlike <a href=#remove><code>_.remove</code></a>, this method returns a new array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new filtered array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['fred']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => objects for ['barney']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['fred']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => objects for ['barney']</span></div></pre></div></div><div><h3 id=find><a href=#find class="fa fa-link"></a><code>_.find(collection, [predicate=_.identity], [fromIndex=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9214>source</a> <a href=https://www.npmjs.com/package/lodash.find>npm package</a><p>Iterates over elements of <code>collection</code>, returning the first element <code>predicate</code> returns truthy for. The predicate is invoked with three arguments: <em>(value, index|key, collection)</em>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[fromIndex=0]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the matched element, else <code>undefined</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=support>find</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>age &lt; <span class=numeric>40</span>; });</div><div><span class=comment>// => object for 'barney'</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=support>find</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => object for 'pebbles'</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=support>find</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => object for 'fred'</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=support>find</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => object for 'barney'</span></div></pre></div></div><div><h3 id=findLast><a href=#findLast class="fa fa-link"></a><code>_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9235>source</a> <a href=https://www.npmjs.com/package/lodash.findlast>npm package</a><p>This method is like <a href=#find><code>_.find</code></a> except that it iterates over elements of <code>collection</code> from right to left.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[fromIndex=collection.length-1]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the matched element, else <code>undefined</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>findLast</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>]<span class=delimiter>,</span> <span class=type>function</span>(n) {</div><div>  return n % <span class=numeric>2</span> == <span class=numeric>1</span>;</div><div>});</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=flatMap><a href=#flatMap class="fa fa-link"></a><code>_.flatMap(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9258>source</a> <a href=https://www.npmjs.com/package/lodash.flatmap>npm package</a><p>Creates a flattened array of values by running each element in <code>collection</code> thru <code>iteratee</code> and flattening the mapped results. The iteratee is invoked with three arguments: <em>(value, index|key, collection)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>duplicate</span>(n) {</div><div>  return [n<span class=delimiter>,</span> n];</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>flatMap</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> duplicate);</div><div><span class=comment>// => [1, 1, 2, 2]</span></div></pre></div></div><div><h3 id=flatMapDeep><a href=#flatMapDeep class="fa fa-link"></a><code>_.flatMapDeep(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9282>source</a> <a href=https://www.npmjs.com/package/lodash.flatmapdeep>npm package</a><p>This method is like <a href=#flatMap><code>_.flatMap</code></a> except that it recursively flattens the mapped results.<h4>Since</h4><p>4.7.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>duplicate</span>(n) {</div><div>  return [[[n<span class=delimiter>,</span> n]]];</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>flatMapDeep</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> duplicate);</div><div><span class=comment>// => [1, 1, 2, 2]</span></div></pre></div></div><div><h3 id=flatMapDepth><a href=#flatMapDepth class="fa fa-link"></a><code>_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9307>source</a> <a href=https://www.npmjs.com/package/lodash.flatmapdepth>npm package</a><p>This method is like <a href=#flatMap><code>_.flatMap</code></a> except that it recursively flattens the mapped results up to <code>depth</code> times.<h4>Since</h4><p>4.7.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[depth=1]</code> <em>(number)</em>: The maximum recursion depth.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new flattened array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>duplicate</span>(n) {</div><div>  return [[[n<span class=delimiter>,</span> n]]];</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>flatMapDepth</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> duplicate<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [[1, 1], [2, 2]]</span></div></pre></div></div><div><h3 id=forEach><a href=#forEach class="fa fa-link"></a><code>_.forEach(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9342>source</a> <a href=https://www.npmjs.com/package/lodash.foreach>npm package</a><p>Iterates over elements of <code>collection</code> and invokes <code>iteratee</code> for each element. The iteratee is invoked with three arguments: <em>(value, index|key, collection)</em>. Iteratee functions may exit iteration early by explicitly returning <code>false</code>.<br><br><strong>Note:</strong> As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior use <a href=#forIn><code>_.forIn</code></a> or <a href=#forOwn><code>_.forOwn</code></a> for object iteration.<h4>Since</h4><p>0.1.0<h4>Aliases</h4><p><em>_.each</em><h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(*)</em>: Returns <code>collection</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>forEach</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=type>function</span>(value) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(value);</div><div>});</div><div><span class=comment>// => Logs `1` then `2`.</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forEach</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(key);</div><div>});</div><div><span class=comment>// => Logs 'a' then 'b' (iteration order is not guaranteed).</span></div></pre></div></div><div><h3 id=forEachRight><a href=#forEachRight class="fa fa-link"></a><code>_.forEachRight(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9367>source</a> <a href=https://www.npmjs.com/package/lodash.foreachright>npm package</a><p>This method is like <a href=#forEach><code>_.forEach</code></a> except that it iterates over elements of <code>collection</code> from right to left.<h4>Since</h4><p>2.0.0<h4>Aliases</h4><p><em>_.eachRight</em><h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(*)</em>: Returns <code>collection</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>forEachRight</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=type>function</span>(value) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(value);</div><div>});</div><div><span class=comment>// => Logs `2` then `1`.</span></div></pre></div></div><div><h3 id=groupBy><a href=#groupBy class="fa fa-link"></a><code>_.groupBy(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9395>source</a> <a href=https://www.npmjs.com/package/lodash.groupby>npm package</a><p>Creates an object composed of keys generated from the results of running each element of <code>collection</code> thru <code>iteratee</code>. The order of grouped values is determined by the order they occur in <code>collection</code>. The corresponding value of each key is an array of elements responsible for generating the key. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee to transform keys.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the composed aggregate object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>groupBy</span>([<span class=numeric>6<span class=delimiter>.</span>1</span><span class=delimiter>,</span> <span class=numeric>4<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>6<span class=delimiter>.</span>3</span>]<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>floor);</div><div><span class=comment>// => { '4': [4.2], '6': [6.1, 6.3] }</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>groupBy</span>([<span class=string>'one'</span><span class=delimiter>,</span> <span class=string>'two'</span><span class=delimiter>,</span> <span class=string>'three'</span>]<span class=delimiter>,</span> <span class=string>'length'</span>);</div><div><span class=comment>// => { '3': ['one', 'two'], '5': ['three'] }</span></div></pre></div></div><div><h3 id=includes><a href=#includes class="fa fa-link"></a><code>_.includes(collection, value, [fromIndex=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9433>source</a> <a href=https://www.npmjs.com/package/lodash.includes>npm package</a><p>Checks if <code>value</code> is in <code>collection</code>. If <code>collection</code> is a string, it's checked for a substring of <code>value</code>, otherwise <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> is used for equality comparisons. If <code>fromIndex</code> is negative, it's used as the offset from the end of <code>collection</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object|string)</em>: The collection to inspect.<li><code>value</code> <em>(*)</em>: The value to search for.<li><code>[fromIndex=0]</code> <em>(number)</em>: The index to search from.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is found, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>includes</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>includes</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>includes</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>includes</span>(<span class=string>'abcd'</span><span class=delimiter>,</span> <span class=string>'bc'</span>);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=invokeMap><a href=#invokeMap class="fa fa-link"></a><code>_.invokeMap(collection, path, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9469>source</a> <a href=https://www.npmjs.com/package/lodash.invokemap>npm package</a><p>Invokes the method at <code>path</code> of each element in <code>collection</code>, returning an array of the results of each invoked method. Any additional arguments are provided to each invoked method. If <code>path</code> is a function, it's invoked for, and <code>this</code> bound to, each element in <code>collection</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>path</code> <em>(Array|Function|string)</em>: The path of the method to invoke or the function invoked per iteration.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke each method with.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of results.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>invokeMap</span>([[<span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>7</span>]<span class=delimiter>,</span> [<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>1</span>]]<span class=delimiter>,</span> <span class=string>'sort'</span>);</div><div><span class=comment>// => [[1, 5, 7], [1, 2, 3]]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>invokeMap</span>([<span class=numeric>123</span><span class=delimiter>,</span> <span class=numeric>456</span>]<span class=delimiter>,</span> <span class=support>String</span><span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>split<span class=delimiter>,</span> <span class=string>''</span>);</div><div><span class=comment>// => [['1', '2', '3'], ['4', '5', '6']]</span></div></pre></div></div><div><h3 id=keyBy><a href=#keyBy class="fa fa-link"></a><code>_.keyBy(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9508>source</a> <a href=https://www.npmjs.com/package/lodash.keyby>npm package</a><p>Creates an object composed of keys generated from the results of running each element of <code>collection</code> thru <code>iteratee</code>. The corresponding value of each key is the last element responsible for generating the key. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee to transform keys.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the composed aggregate object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [</div><div>  { <span class=string>'dir'</span>: <span class=string>'left'</span><span class=delimiter>,</span> <span class=string>'code'</span>: <span class=numeric>97</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'dir'</span>: <span class=string>'right'</span><span class=delimiter>,</span> <span class=string>'code'</span>: <span class=numeric>100</span> }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>keyBy</span>(array<span class=delimiter>,</span> <span class=type>function</span>(o) {</div><div>  return <span class=support>String</span><span class="delimiter method">.</span><span class=support>fromCharCode</span>(o<span class=delimiter>.</span><span class=support>code</span>);</div><div>});</div><div><span class=comment>// => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>keyBy</span>(array<span class=delimiter>,</span> <span class=string>'dir'</span>);</div><div><span class=comment>// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }</span></div></pre></div></div><div><h3 id=map><a href=#map class="fa fa-link"></a><code>_.map(collection, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9554>source</a> <a href=https://www.npmjs.com/package/lodash.map>npm package</a><p>Creates an array of values by running each element in <code>collection</code> thru <code>iteratee</code>. The iteratee is invoked with three arguments:<br><em>(value, index|key, collection)</em>.<br><br>Many lodash methods are guarded to work as iteratees for methods like <a href=#every><code>_.every</code></a>, <a href=#filter><code>_.filter</code></a>, <a href=#map><code>_.map</code></a>, <a href=#mapValues><code>_.mapValues</code></a>, <a href=#reject><code>_.reject</code></a>, and <a href=#some><code>_.some</code></a>.<br><br>The guarded methods are:<br><code>ary</code>, <code>chunk</code>, <code>curry</code>, <code>curryRight</code>, <code>drop</code>, <code>dropRight</code>, <code>every</code>, <code>fill</code>, <code>invert</code>, <code>parseInt</code>, <code>random</code>, <code>range</code>, <code>rangeRight</code>, <code>repeat</code>, <code>sampleSize</code>, <code>slice</code>, <code>some</code>, <code>sortBy</code>, <code>split</code>, <code>take</code>, <code>takeRight</code>, <code>template</code>, <code>trim</code>, <code>trimEnd</code>, <code>trimStart</code>, and <code>words</code><h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new mapped array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>8</span>]<span class=delimiter>,</span> square);</div><div><span class=comment>// => [16, 64]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>({ <span class=string>'a'</span>: <span class=numeric>4</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>8</span> }<span class=delimiter>,</span> square);</div><div><span class=comment>// => [16, 64] (iteration order is not guaranteed)</span></div><div> </div><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span> }</div><div>];</div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>map</span>(users<span class=delimiter>,</span> <span class=string>'user'</span>);</div><div><span class=comment>// => ['barney', 'fred']</span></div></pre></div></div><div><h3 id=orderBy><a href=#orderBy class="fa fa-link"></a><code>_.orderBy(collection, [iteratees=[_.identity]], [orders])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9588>source</a> <a href=https://www.npmjs.com/package/lodash.orderby>npm package</a><p>This method is like <a href=#sortBy><code>_.sortBy</code></a> except that it allows specifying the sort orders of the iteratees to sort by. If <code>orders</code> is unspecified, all values are sorted in ascending order. Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order of corresponding values.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratees=[_.identity]]</code> <em>(Array[]|Function[]|Object[]|string[])</em>: The iteratees to sort by.<li><code>[orders]</code> <em>(string[])</em>: The sort orders of <code>iteratees</code>.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new sorted array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>48</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>34</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span> }</div><div>];</div><div> </div><div><span class=comment>// Sort by `user` in ascending order and by `age` in descending order.</span></div><div>_<span class="delimiter method">.</span><span class=name>orderBy</span>(users<span class=delimiter>,</span> [<span class=string>'user'</span><span class=delimiter>,</span> <span class=string>'age'</span>]<span class=delimiter>,</span> [<span class=string>'asc'</span><span class=delimiter>,</span> <span class=string>'desc'</span>]);</div><div><span class=comment>// => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]</span></div></pre></div></div><div><h3 id=partition><a href=#partition class="fa fa-link"></a><code>_.partition(collection, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9638>source</a> <a href=https://www.npmjs.com/package/lodash.partition>npm package</a><p>Creates an array of elements split into two groups, the first of which contains elements <code>predicate</code> returns truthy for, the second of which contains elements <code>predicate</code> returns falsey for. The predicate is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of grouped elements.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span>  <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>partition</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for [['fred'], ['barney', 'pebbles']]</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>partition</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => objects for [['pebbles'], ['barney', 'fred']]</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>partition</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for [['barney', 'pebbles'], ['fred']]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>partition</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => objects for [['fred'], ['barney', 'pebbles']]</span></div></pre></div></div><div><h3 id=reduce><a href=#reduce class="fa fa-link"></a><code>_.reduce(collection, [iteratee=_.identity], [accumulator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9679>source</a> <a href=https://www.npmjs.com/package/lodash.reduce>npm package</a><p>Reduces <code>collection</code> to a value which is the accumulated result of running each element in <code>collection</code> thru <code>iteratee</code>, where each successive invocation is supplied the return value of the previous. If <code>accumulator</code> is not given, the first element of <code>collection</code> is used as the initial value. The iteratee is invoked with four arguments:<br><em>(accumulator, value, index|key, collection)</em>.<br><br>Many lodash methods are guarded to work as iteratees for methods like <a href=#reduce><code>_.reduce</code></a>, <a href=#reduceRight><code>_.reduceRight</code></a>, and <a href=#transform><code>_.transform</code></a>.<br><br>The guarded methods are:<br><code>assign</code>, <code>defaults</code>, <code>defaultsDeep</code>, <code>includes</code>, <code>merge</code>, <code>orderBy</code>, and <code>sortBy</code><h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[accumulator]</code> <em>(*)</em>: The initial value.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the accumulated value.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>reduce</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span> <span class=type>function</span>(sum<span class=delimiter>,</span> n) {</div><div>  return sum + n;</div><div>}<span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>reduce</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> <span class=type>function</span>(result<span class=delimiter>,</span> value<span class=delimiter>,</span> key) {</div><div>  (result[value] || (result[value] = []))<span class="delimiter method">.</span><span class=support>push</span>(key);</div><div>  return result;</div><div>}<span class=delimiter>,</span> {});</div><div><span class=comment>// => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)</span></div></pre></div></div><div><h3 id=reduceRight><a href=#reduceRight class="fa fa-link"></a><code>_.reduceRight(collection, [iteratee=_.identity], [accumulator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9708>source</a> <a href=https://www.npmjs.com/package/lodash.reduceright>npm package</a><p>This method is like <a href=#reduce><code>_.reduce</code></a> except that it iterates over elements of <code>collection</code> from right to left.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[accumulator]</code> <em>(*)</em>: The initial value.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the accumulated value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [[<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>1</span>]<span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> [<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>5</span>]];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>reduceRight</span>(array<span class=delimiter>,</span> <span class=type>function</span>(flattened<span class=delimiter>,</span> other) {</div><div>  return flattened<span class="delimiter method">.</span><span class=support>concat</span>(other);</div><div>}<span class=delimiter>,</span> []);</div><div><span class=comment>// => [4, 5, 2, 3, 0, 1]</span></div></pre></div></div><div><h3 id=reject><a href=#reject class="fa fa-link"></a><code>_.reject(collection, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9749>source</a> <a href=https://www.npmjs.com/package/lodash.reject>npm package</a><p>The opposite of <a href=#filter><code>_.filter</code></a>; this method returns the elements of <code>collection</code> that <code>predicate</code> does <strong>not</strong> return truthy for.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new filtered array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>reject</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return !o<span class=delimiter>.</span>active; });</div><div><span class=comment>// => objects for ['fred']</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>reject</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => objects for ['barney']</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>reject</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => objects for ['fred']</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>reject</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => objects for ['barney']</span></div></pre></div></div><div><h3 id=sample><a href=#sample class="fa fa-link"></a><code>_.sample(collection)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9768>source</a> <a href=https://www.npmjs.com/package/lodash.sample>npm package</a><p>Gets a random element from <code>collection</code>.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to sample.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the random element.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sample</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>]);</div><div><span class=comment>// => 2</span></div></pre></div></div><div><h3 id=sampleSize><a href=#sampleSize class="fa fa-link"></a><code>_.sampleSize(collection, [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9793>source</a> <a href=https://www.npmjs.com/package/lodash.samplesize>npm package</a><p>Gets <code>n</code> random elements at unique keys from <code>collection</code> up to the size of <code>collection</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to sample.<li><code>[n=1]</code> <em>(number)</em>: The number of elements to sample.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the random elements.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sampleSize</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => [3, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sampleSize</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]<span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => [2, 3, 1]</span></div></pre></div></div><div><h3 id=shuffle><a href=#shuffle class="fa fa-link"></a><code>_.shuffle(collection)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9818>source</a> <a href=https://www.npmjs.com/package/lodash.shuffle>npm package</a><p>Creates an array of shuffled values, using a version of the <a href=https://en.wikipedia.org/wiki/Fisher-Yates_shuffle>Fisher-Yates shuffle</a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to shuffle.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new shuffled array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>shuffle</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>]);</div><div><span class=comment>// => [4, 1, 3, 2]</span></div></pre></div></div><div><h3 id=size><a href=#size class="fa fa-link"></a><code>_.size(collection)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9844>source</a> <a href=https://www.npmjs.com/package/lodash.size>npm package</a><p>Gets the size of <code>collection</code> by returning its length for array-like values or the number of own enumerable string keyed properties for objects.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object|string)</em>: The collection to inspect.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the collection size.<h4>Example</h4><div class="highlight js"><pre><div>_<span class=delimiter>.</span><span class=support>size</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class=delimiter>.</span><span class=support>size</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> });</div><div><span class=comment>// => 2</span></div><div> </div><div>_<span class=delimiter>.</span><span class=support>size</span>(<span class=string>'pebbles'</span>);</div><div><span class=comment>// => 7</span></div></pre></div></div><div><h3 id=some><a href=#some class="fa fa-link"></a><code>_.some(collection, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9894>source</a> <a href=https://www.npmjs.com/package/lodash.some>npm package</a><p>Checks if <code>predicate</code> returns truthy for <strong>any</strong> element of <code>collection</code>. Iteration is stopped once <code>predicate</code> returns truthy. The predicate is invoked with three arguments: <em>(value, index|key, collection)</em>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if any element passes the predicate check, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>some</span>([null<span class=delimiter>,</span> <span class=numeric>0</span><span class=delimiter>,</span> <span class=string>'yes'</span><span class=delimiter>,</span> false]<span class=delimiter>,</span> <span class=support>Boolean</span>);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>some</span>(users<span class=delimiter>,</span> { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: false });</div><div><span class=comment>// => false</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>some</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>some</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=sortBy><a href=#sortBy class="fa fa-link"></a><code>_.sortBy(collection, [iteratees=[_.identity]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9931>source</a> <a href=https://www.npmjs.com/package/lodash.sortby>npm package</a><p>Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>collection</code> <em>(Array|Object)</em>: The collection to iterate over.<li><code>[iteratees=[_.identity]]</code> <em>(...(Function|Function[]))</em>: The iteratees to sort by.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new sorted array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>48</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>34</span> }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sortBy</span>(users<span class=delimiter>,</span> [<span class=type>function</span>(o) { return o<span class=delimiter>.</span>user; }]);</div><div><span class=comment>// => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sortBy</span>(users<span class=delimiter>,</span> [<span class=string>'user'</span><span class=delimiter>,</span> <span class=string>'age'</span>]);</div><div><span class=comment>// => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]</span></div></pre></div></div></div><div><h2><code>“Date” Methods</code></h2><div><h3 id=now><a href=#now class="fa fa-link"></a><code>_.now()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9962>source</a> <a href=https://www.npmjs.com/package/lodash.now>npm package</a><p>Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch <em>(1 January <code>1970 00</code>:00:00 UTC)</em>.<h4>Since</h4><p>2.4.0<h4>Returns</h4><p><em>(number)</em>: Returns the timestamp.<h4>Example</h4><div class="highlight js"><pre><div>_<span class=delimiter>.</span><span class=support>defer</span>(<span class=type>function</span>(stamp) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(_<span class="delimiter method">.</span><span class=name>now</span>() - stamp);</div><div>}<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>now</span>());</div><div><span class=comment>// => Logs the number of milliseconds it took for the deferred invocation.</span></div></pre></div></div></div><div><h2><code>“Function” Methods</code></h2><div><h3 id=after><a href=#after class="fa fa-link"></a><code>_.after(n, func)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9992>source</a> <a href=https://www.npmjs.com/package/lodash.after>npm package</a><p>The opposite of <a href=#before><code>_.before</code></a>; this method creates a function that invokes <code>func</code> once it's called <code>n</code> or more times.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>n</code> <em>(number)</em>: The number of calls before <code>func</code> is invoked.<li><code>func</code> <em>(Function)</em>: The function to restrict.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new restricted function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> saves = [<span class=string>'profile'</span><span class=delimiter>,</span> <span class=string>'settings'</span>];</div><div> </div><div><span class=type>var</span> done = _<span class="delimiter method">.</span><span class=name>after</span>(saves<span class=delimiter>.</span><span class=support>length</span><span class=delimiter>,</span> <span class=type>function</span>() {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(<span class=string>'done saving!'</span>);</div><div>});</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forEach</span>(saves<span class=delimiter>,</span> <span class=type>function</span>(type) {</div><div>  <span class=name>asyncSave</span>({ <span class=string>'type'</span>: type<span class=delimiter>,</span> <span class=string>'complete'</span>: done });</div><div>});</div><div><span class=comment>// => Logs 'done saving!' after the two async saves have completed.</span></div></pre></div></div><div><h3 id=ary><a href=#ary class="fa fa-link"></a><code>_.ary(func, [n=func.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10021>source</a> <a href=https://www.npmjs.com/package/lodash.ary>npm package</a><p>Creates a function that invokes <code>func</code>, with up to <code>n</code> arguments, ignoring any additional arguments.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to cap arguments for.<li><code>[n=func.length]</code> <em>(number)</em>: The arity cap.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new capped function.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'6'</span><span class=delimiter>,</span> <span class=string>'8'</span><span class=delimiter>,</span> <span class=string>'10'</span>]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>ary</span>(parseInt<span class=delimiter>,</span> <span class=numeric>1</span>));</div><div><span class=comment>// => [6, 8, 10]</span></div></pre></div></div><div><h3 id=before><a href=#before class="fa fa-link"></a><code>_.before(n, func)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10044>source</a> <a href=https://www.npmjs.com/package/lodash.before>npm package</a><p>Creates a function that invokes <code>func</code>, with the <code>this</code> binding and arguments of the created function, while it's called less than <code>n</code> times. Subsequent calls to the created function return the result of the last <code>func</code> invocation.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>n</code> <em>(number)</em>: The number of calls at which <code>func</code> is no longer invoked.<li><code>func</code> <em>(Function)</em>: The function to restrict.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new restricted function.<h4>Example</h4><div class="highlight js"><pre><div><span class=name>jQuery</span>(element)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'click'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>before</span>(<span class=numeric>5</span><span class=delimiter>,</span> addContactToList));</div><div><span class=comment>// => Allows adding up to 4 contacts to the list.</span></div></pre></div></div><div><h3 id=bind><a href=#bind class="fa fa-link"></a><code>_.bind(func, thisArg, [partials])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10096>source</a> <a href=https://www.npmjs.com/package/lodash.bind>npm package</a><p>Creates a function that invokes <code>func</code> with the <code>this</code> binding of <code>thisArg</code> and <code>partials</code> prepended to the arguments it receives.<br><br>The <code>_.bind.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for partially applied arguments.<br><br><strong>Note:</strong> Unlike native <code>Function#bind</code>, this method doesn't set the "length" property of bound functions.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to bind.<li><code>thisArg</code> <em>(*)</em>: The <code>this</code> binding of <code>func</code>.<li><code>[partials]</code> <em>(...*)</em>: The arguments to be partially applied.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new bound function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>greet</span>(greeting<span class=delimiter>,</span> punctuation) {</div><div>  return greeting + <span class=string>' '</span> + this<span class=delimiter>.</span>user + punctuation;</div><div>}</div><div> </div><div><span class=type>var</span> object = { <span class=string>'user'</span>: <span class=string>'fred'</span> };</div><div> </div><div><span class=type>var</span> bound = _<span class="delimiter method">.</span><span class=name>bind</span>(greet<span class=delimiter>,</span> object<span class=delimiter>,</span> <span class=string>'hi'</span>);</div><div><span class=name>bound</span>(<span class=string>'!'</span>);</div><div><span class=comment>// => 'hi fred!'</span></div><div> </div><div><span class=comment>// Bound with placeholders.</span></div><div><span class=type>var</span> bound = _<span class="delimiter method">.</span><span class=name>bind</span>(greet<span class=delimiter>,</span> object<span class=delimiter>,</span> _<span class=delimiter>,</span> <span class=string>'!'</span>);</div><div><span class=name>bound</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => 'hi fred!'</span></div></pre></div></div><div><h3 id=bindKey><a href=#bindKey class="fa fa-link"></a><code>_.bindKey(object, key, [partials])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10150>source</a> <a href=https://www.npmjs.com/package/lodash.bindkey>npm package</a><p>Creates a function that invokes the method at <code>object[key]</code> with <code>partials</code> prepended to the arguments it receives.<br><br>This method differs from <a href=#bind><code>_.bind</code></a> by allowing bound functions to reference methods that may be redefined or don't yet exist. See <a href=http://peter.michaux.ca/articles/lazy-function-definition-pattern>Peter Michaux's article</a> for more details.<br><br>The <code>_.bindKey.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for partially applied arguments.<h4>Since</h4><p>0.10.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to invoke the method on.<li><code>key</code> <em>(string)</em>: The key of the method.<li><code>[partials]</code> <em>(...*)</em>: The arguments to be partially applied.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new bound function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = {</div><div>  <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span></div><div>  <span class=string>'greet'</span>: <span class=type>function</span>(greeting<span class=delimiter>,</span> punctuation) {</div><div>    return greeting + <span class=string>' '</span> + this<span class=delimiter>.</span>user + punctuation;</div><div>  }</div><div>};</div><div> </div><div><span class=type>var</span> bound = _<span class="delimiter method">.</span><span class=name>bindKey</span>(object<span class=delimiter>,</span> <span class=string>'greet'</span><span class=delimiter>,</span> <span class=string>'hi'</span>);</div><div><span class=name>bound</span>(<span class=string>'!'</span>);</div><div><span class=comment>// => 'hi fred!'</span></div><div> </div><div>object<span class="delimiter method">.</span><span class=name>greet</span> = <span class=type>function</span>(greeting<span class=delimiter>,</span> punctuation) {</div><div>  return greeting + <span class=string>'ya '</span> + this<span class=delimiter>.</span>user + punctuation;</div><div>};</div><div> </div><div><span class=name>bound</span>(<span class=string>'!'</span>);</div><div><span class=comment>// => 'hiya fred!'</span></div><div> </div><div><span class=comment>// Bound with placeholders.</span></div><div><span class=type>var</span> bound = _<span class="delimiter method">.</span><span class=name>bindKey</span>(object<span class=delimiter>,</span> <span class=string>'greet'</span><span class=delimiter>,</span> _<span class=delimiter>,</span> <span class=string>'!'</span>);</div><div><span class=name>bound</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => 'hiya fred!'</span></div></pre></div></div><div><h3 id=curry><a href=#curry class="fa fa-link"></a><code>_.curry(func, [arity=func.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10200>source</a> <a href=https://www.npmjs.com/package/lodash.curry>npm package</a><p>Creates a function that accepts arguments of <code>func</code> and either invokes <code>func</code> returning its result, if at least <code>arity</code> number of arguments have been provided, or returns a function that accepts the remaining <code>func</code> arguments, and so on. The arity of <code>func</code> may be specified if <code>func.length</code> is not sufficient.<br><br>The <code>_.curry.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for provided arguments.<br><br><strong>Note:</strong> This method doesn't set the "length" property of curried functions.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to curry.<li><code>[arity=func.length]</code> <em>(number)</em>: The arity of <code>func</code>.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new curried function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> <span class=name>abc</span> = <span class=type>function</span>(a<span class=delimiter>,</span> b<span class=delimiter>,</span> c) {</div><div>  return [a<span class=delimiter>,</span> b<span class=delimiter>,</span> c];</div><div>};</div><div> </div><div><span class=type>var</span> curried = _<span class="delimiter method">.</span><span class=name>curry</span>(abc);</div><div> </div><div><span class=name>curried</span>(<span class=numeric>1</span>)(<span class=numeric>2</span>)(<span class=numeric>3</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=name>curried</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>)(<span class=numeric>3</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=name>curried</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=comment>// Curried with placeholders.</span></div><div><span class=name>curried</span>(<span class=numeric>1</span>)(_<span class=delimiter>,</span> <span class=numeric>3</span>)(<span class=numeric>2</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=curryRight><a href=#curryRight class="fa fa-link"></a><code>_.curryRight(func, [arity=func.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10245>source</a> <a href=https://www.npmjs.com/package/lodash.curryright>npm package</a><p>This method is like <a href=#curry><code>_.curry</code></a> except that arguments are applied to <code>func</code> in the manner of <a href=#partialRight><code>_.partialRight</code></a> instead of <a href=#partial><code>_.partial</code></a>.<br><br>The <code>_.curryRight.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for provided arguments.<br><br><strong>Note:</strong> This method doesn't set the "length" property of curried functions.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to curry.<li><code>[arity=func.length]</code> <em>(number)</em>: The arity of <code>func</code>.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new curried function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> <span class=name>abc</span> = <span class=type>function</span>(a<span class=delimiter>,</span> b<span class=delimiter>,</span> c) {</div><div>  return [a<span class=delimiter>,</span> b<span class=delimiter>,</span> c];</div><div>};</div><div> </div><div><span class=type>var</span> curried = _<span class="delimiter method">.</span><span class=name>curryRight</span>(abc);</div><div> </div><div><span class=name>curried</span>(<span class=numeric>3</span>)(<span class=numeric>2</span>)(<span class=numeric>1</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=name>curried</span>(<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>)(<span class=numeric>1</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=name>curried</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div><span class=comment>// Curried with placeholders.</span></div><div><span class=name>curried</span>(<span class=numeric>3</span>)(<span class=numeric>1</span><span class=delimiter>,</span> _)(<span class=numeric>2</span>);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=debounce><a href=#debounce class="fa fa-link"></a><code>_.debounce(func, [wait=0], [options={}])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10306>source</a> <a href=https://www.npmjs.com/package/lodash.debounce>npm package</a><p>Creates a debounced function that delays invoking <code>func</code> until after <code>wait</code> milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a <code>cancel</code> method to cancel delayed <code>func</code> invocations and a <code>flush</code> method to immediately invoke them. Provide <code>options</code> to indicate whether <code>func</code> should be invoked on the leading and/or trailing edge of the <code>wait</code> timeout. The <code>func</code> is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last <code>func</code> invocation.<br><br><strong>Note:</strong> If <code>leading</code> and <code>trailing</code> options are <code>true</code>, <code>func</code> is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the <code>wait</code> timeout.<br><br>If <code>wait</code> is <code>0</code> and <code>leading</code> is <code>false</code>, <code>func</code> invocation is deferred until to the next tick, similar to <code>setTimeout</code> with a timeout of <code>0</code>.<br><br>See <a href=https://css-tricks.com/debouncing-throttling-explained-examples/ >David Corbacho's article</a> for details over the differences between <a href=#debounce><code>_.debounce</code></a> and <a href=#throttle><code>_.throttle</code></a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to debounce.<li><code>[wait=0]</code> <em>(number)</em>: The number of milliseconds to delay.<li><code>[options={}]</code> <em>(Object)</em>: The options object.<li><code>[options.leading=false]</code> <em>(boolean)</em>: Specify invoking on the leading edge of the timeout.<li><code>[options.maxWait]</code> <em>(number)</em>: The maximum time <code>func</code> is allowed to be delayed before it's invoked.<li><code>[options.trailing=true]</code> <em>(boolean)</em>: Specify invoking on the trailing edge of the timeout.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new debounced function.<h4>Example</h4><div class="highlight js"><pre><div><span class=comment>// Avoid costly calculations while the window size is in flux.</span></div><div><span class=name>jQuery</span>(<span class=support>window</span>)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'resize'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>debounce</span>(calculateLayout<span class=delimiter>,</span> <span class=numeric>150</span>));</div><div> </div><div><span class=comment>// Invoke `sendMail` when clicked, debouncing subsequent calls.</span></div><div><span class=name>jQuery</span>(element)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'click'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>debounce</span>(sendMail<span class=delimiter>,</span> <span class=numeric>300</span><span class=delimiter>,</span> {</div><div>  <span class=string>'leading'</span>: true<span class=delimiter>,</span></div><div>  <span class=string>'trailing'</span>: false</div><div>}));</div><div> </div><div><span class=comment>// Ensure `batchLog` is invoked once after 1 second of debounced calls.</span></div><div><span class=type>var</span> debounced = _<span class="delimiter method">.</span><span class=name>debounce</span>(batchLog<span class=delimiter>,</span> <span class=numeric>250</span><span class=delimiter>,</span> { <span class=string>'maxWait'</span>: <span class=numeric>1000</span> });</div><div><span class=type>var</span> source = new <span class="name type">EventSource</span>(<span class=string>'/stream'</span>);</div><div><span class=name>jQuery</span>(source)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'message'</span><span class=delimiter>,</span> debounced);</div><div> </div><div><span class=comment>// Cancel the trailing debounced invocation.</span></div><div><span class=name>jQuery</span>(<span class=support>window</span>)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'popstate'</span><span class=delimiter>,</span> debounced<span class=delimiter>.</span>cancel);</div></pre></div></div><div><h3 id=defer><a href=#defer class="fa fa-link"></a><code>_.defer(func, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10446>source</a> <a href=https://www.npmjs.com/package/lodash.defer>npm package</a><p>Defers invoking the <code>func</code> until the current call stack has cleared. Any additional arguments are provided to <code>func</code> when it's invoked.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to defer.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke <code>func</code> with.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the timer id.<h4>Example</h4><div class="highlight js"><pre><div>_<span class=delimiter>.</span><span class=support>defer</span>(<span class=type>function</span>(text) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(text);</div><div>}<span class=delimiter>,</span> <span class=string>'deferred'</span>);</div><div><span class=comment>// => Logs 'deferred' after one millisecond.</span></div></pre></div></div><div><h3 id=delay><a href=#delay class="fa fa-link"></a><code>_.delay(func, wait, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10469>source</a> <a href=https://www.npmjs.com/package/lodash.delay>npm package</a><p>Invokes <code>func</code> after <code>wait</code> milliseconds. Any additional arguments are provided to <code>func</code> when it's invoked.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to delay.<li><code>wait</code> <em>(number)</em>: The number of milliseconds to delay invocation.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke <code>func</code> with.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the timer id.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>delay</span>(<span class=type>function</span>(text) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(text);</div><div>}<span class=delimiter>,</span> <span class=numeric>1000</span><span class=delimiter>,</span> <span class=string>'later'</span>);</div><div><span class=comment>// => Logs 'later' after one second.</span></div></pre></div></div><div><h3 id=flip><a href=#flip class="fa fa-link"></a><code>_.flip(func)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10491>source</a> <a href=https://www.npmjs.com/package/lodash.flip>npm package</a><p>Creates a function that invokes <code>func</code> with arguments reversed.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to flip arguments for.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new flipped function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> flipped = _<span class="delimiter method">.</span><span class=name>flip</span>(<span class=type>function</span>() {</div><div>  return _<span class="delimiter method">.</span><span class=name>toArray</span>(arguments);</div><div>});</div><div> </div><div><span class=name>flipped</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>);</div><div><span class=comment>// => ['d', 'c', 'b', 'a']</span></div></pre></div></div><div><h3 id=memoize><a href=#memoize class="fa fa-link"></a><code>_.memoize(func, [resolver])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10539>source</a> <a href=https://www.npmjs.com/package/lodash.memoize>npm package</a><p>Creates a function that memoizes the result of <code>func</code>. If <code>resolver</code> is provided, it determines the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the map cache key. The <code>func</code> is invoked with the <code>this</code> binding of the memoized function.<br><br><strong>Note:</strong> The cache is exposed as the <code>cache</code> property on the memoized function. Its creation may be customized by replacing the <code>_.memoize.Cache</code> constructor with one whose instances implement the <a href=http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object><code>Map</code></a> method interface of <code>clear</code>, <code>delete</code>, <code>get</code>, <code>has</code>, and <code>set</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to have its output memoized.<li><code>[resolver]</code> <em>(Function)</em>: The function to resolve the cache key.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new memoized function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> };</div><div><span class=type>var</span> other = { <span class=string>'c'</span>: <span class=numeric>3</span><span class=delimiter>,</span> <span class=string>'d'</span>: <span class=numeric>4</span> };</div><div> </div><div><span class=type>var</span> values = _<span class="delimiter method">.</span><span class=name>memoize</span>(_<span class=delimiter>.</span>values);</div><div><span class=name>values</span>(object);</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div><span class=name>values</span>(other);</div><div><span class=comment>// => [3, 4]</span></div><div> </div><div>object<span class=delimiter>.</span>a = <span class=numeric>2</span>;</div><div><span class=name>values</span>(object);</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div><span class=comment>// Modify the result cache.</span></div><div>values<span class=delimiter>.</span>cache<span class="delimiter method">.</span><span class=name>set</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]);</div><div><span class=name>values</span>(object);</div><div><span class=comment>// => ['a', 'b']</span></div><div> </div><div><span class=comment>// Replace `_.memoize.Cache`.</span></div><div>_<span class=delimiter>.</span>memoize<span class=delimiter>.</span>Cache = <span class=support>WeakMap</span>;</div></pre></div></div><div><h3 id=negate><a href=#negate class="fa fa-link"></a><code>_.negate(predicate)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10582>source</a> <a href=https://www.npmjs.com/package/lodash.negate>npm package</a><p>Creates a function that negates the result of the predicate <code>func</code>. The <code>func</code> predicate is invoked with the <code>this</code> binding and arguments of the created function.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>predicate</code> <em>(Function)</em>: The predicate to negate.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new negated function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>isEven</span>(n) {</div><div>  return n % <span class=numeric>2</span> == <span class=numeric>0</span>;</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>filter</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>6</span>]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>negate</span>(isEven));</div><div><span class=comment>// => [1, 3, 5]</span></div></pre></div></div><div><h3 id=once><a href=#once class="fa fa-link"></a><code>_.once(func)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10616>source</a> <a href=https://www.npmjs.com/package/lodash.once>npm package</a><p>Creates a function that is restricted to invoking <code>func</code> once. Repeat calls to the function return the value of the first invocation. The <code>func</code> is invoked with the <code>this</code> binding and arguments of the created function.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to restrict.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new restricted function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> initialize = _<span class="delimiter method">.</span><span class=name>once</span>(createApplication);</div><div><span class=name>initialize</span>();</div><div><span class=name>initialize</span>();</div><div><span class=comment>// => `createApplication` is invoked once</span></div></pre></div></div><div><h3 id=overArgs><a href=#overArgs class="fa fa-link"></a><code>_.overArgs(func, [transforms=[_.identity]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10651>source</a> <a href=https://www.npmjs.com/package/lodash.overargs>npm package</a><p>Creates a function that invokes <code>func</code> with its arguments transformed.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to wrap.<li><code>[transforms=[_.identity]]</code> <em>(...(Function|Function[]))</em>: The argument transforms.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>doubled</span>(n) {</div><div>  return n * <span class=numeric>2</span>;</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>overArgs</span>(<span class=type>function</span>(x<span class=delimiter>,</span> y) {</div><div>  return [x<span class=delimiter>,</span> y];</div><div>}<span class=delimiter>,</span> [square<span class=delimiter>,</span> doubled]);</div><div> </div><div><span class=name>func</span>(<span class=numeric>9</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [81, 6]</span></div><div> </div><div><span class=name>func</span>(<span class=numeric>10</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [100, 10]</span></div></pre></div></div><div><h3 id=partial><a href=#partial class="fa fa-link"></a><code>_.partial(func, [partials])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10701>source</a> <a href=https://www.npmjs.com/package/lodash.partial>npm package</a><p>Creates a function that invokes <code>func</code> with <code>partials</code> prepended to the arguments it receives. This method is like <a href=#bind><code>_.bind</code></a> except it does <strong>not</strong> alter the <code>this</code> binding.<br><br>The <code>_.partial.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for partially applied arguments.<br><br><strong>Note:</strong> This method doesn't set the "length" property of partially applied functions.<h4>Since</h4><p>0.2.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to partially apply arguments to.<li><code>[partials]</code> <em>(...*)</em>: The arguments to be partially applied.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new partially applied function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>greet</span>(greeting<span class=delimiter>,</span> name) {</div><div>  return greeting + <span class=string>' '</span> + name;</div><div>}</div><div> </div><div><span class=type>var</span> sayHelloTo = _<span class="delimiter method">.</span><span class=name>partial</span>(greet<span class=delimiter>,</span> <span class=string>'hello'</span>);</div><div><span class=name>sayHelloTo</span>(<span class=string>'fred'</span>);</div><div><span class=comment>// => 'hello fred'</span></div><div> </div><div><span class=comment>// Partially applied with placeholders.</span></div><div><span class=type>var</span> greetFred = _<span class="delimiter method">.</span><span class=name>partial</span>(greet<span class=delimiter>,</span> _<span class=delimiter>,</span> <span class=string>'fred'</span>);</div><div><span class=name>greetFred</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => 'hi fred'</span></div></pre></div></div><div><h3 id=partialRight><a href=#partialRight class="fa fa-link"></a><code>_.partialRight(func, [partials])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10738>source</a> <a href=https://www.npmjs.com/package/lodash.partialright>npm package</a><p>This method is like <a href=#partial><code>_.partial</code></a> except that partially applied arguments are appended to the arguments it receives.<br><br>The <code>_.partialRight.placeholder</code> value, which defaults to <code>_</code> in monolithic builds, may be used as a placeholder for partially applied arguments.<br><br><strong>Note:</strong> This method doesn't set the "length" property of partially applied functions.<h4>Since</h4><p>1.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to partially apply arguments to.<li><code>[partials]</code> <em>(...*)</em>: The arguments to be partially applied.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new partially applied function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>greet</span>(greeting<span class=delimiter>,</span> name) {</div><div>  return greeting + <span class=string>' '</span> + name;</div><div>}</div><div> </div><div><span class=type>var</span> greetFred = _<span class="delimiter method">.</span><span class=name>partialRight</span>(greet<span class=delimiter>,</span> <span class=string>'fred'</span>);</div><div><span class=name>greetFred</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => 'hi fred'</span></div><div> </div><div><span class=comment>// Partially applied with placeholders.</span></div><div><span class=type>var</span> sayHelloTo = _<span class="delimiter method">.</span><span class=name>partialRight</span>(greet<span class=delimiter>,</span> <span class=string>'hello'</span><span class=delimiter>,</span> _);</div><div><span class=name>sayHelloTo</span>(<span class=string>'fred'</span>);</div><div><span class=comment>// => 'hello fred'</span></div></pre></div></div><div><h3 id=rearg><a href=#rearg class="fa fa-link"></a><code>_.rearg(func, indexes)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10765>source</a> <a href=https://www.npmjs.com/package/lodash.rearg>npm package</a><p>Creates a function that invokes <code>func</code> with arguments arranged according to the specified <code>indexes</code> where the argument value at the first index is provided as the first argument, the argument value at the second index is provided as the second argument, and so on.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to rearrange arguments for.<li><code>indexes</code> <em>(...(number|number[]))</em>: The arranged argument indexes.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> rearged = _<span class="delimiter method">.</span><span class=name>rearg</span>(<span class=type>function</span>(a<span class=delimiter>,</span> b<span class=delimiter>,</span> c) {</div><div>  return [a<span class=delimiter>,</span> b<span class=delimiter>,</span> c];</div><div>}<span class=delimiter>,</span> [<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>1</span>]);</div><div> </div><div><span class=name>rearged</span>(<span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'a'</span>)</div><div><span class=comment>// => ['a', 'b', 'c']</span></div></pre></div></div><div><h3 id=rest><a href=#rest class="fa fa-link"></a><code>_.rest(func, [start=func.length-1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10794>source</a> <a href=https://www.npmjs.com/package/lodash.rest>npm package</a><p>Creates a function that invokes <code>func</code> with the <code>this</code> binding of the created function and arguments from <code>start</code> and beyond provided as an array.<br><br><strong>Note:</strong> This method is based on the <a href=https://mdn.io/rest_parameters>rest parameter</a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to apply a rest parameter to.<li><code>[start=func.length-1]</code> <em>(number)</em>: The start position of the rest parameter.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> say = _<span class="delimiter method">.</span><span class=name>rest</span>(<span class=type>function</span>(what<span class=delimiter>,</span> names) {</div><div>  return what + <span class=string>' '</span> + _<span class="delimiter method">.</span><span class=name>initial</span>(names)<span class="delimiter method">.</span><span class=support>join</span>(<span class=string>', '</span>) +</div><div>    (_<span class=delimiter>.</span><span class=support>size</span>(names) > <span class=numeric>1</span> ? <span class=string>', & '</span> : <span class=string>''</span>) + _<span class="delimiter method">.</span><span class=name>last</span>(names);</div><div>});</div><div> </div><div><span class=name>say</span>(<span class=string>'hello'</span><span class=delimiter>,</span> <span class=string>'fred'</span><span class=delimiter>,</span> <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'pebbles'</span>);</div><div><span class=comment>// => 'hello fred, barney, & pebbles'</span></div></pre></div></div><div><h3 id=spread><a href=#spread class="fa fa-link"></a><code>_.spread(func, [start=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10836>source</a> <a href=https://www.npmjs.com/package/lodash.spread>npm package</a><p>Creates a function that invokes <code>func</code> with the <code>this</code> binding of the create function and an array of arguments much like <a href=http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply><code>Function#apply</code></a>.<br><br><strong>Note:</strong> This method is based on the <a href=https://mdn.io/spread_operator>spread operator</a>.<h4>Since</h4><p>3.2.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to spread arguments over.<li><code>[start=0]</code> <em>(number)</em>: The start position of the spread.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> say = _<span class="delimiter method">.</span><span class=name>spread</span>(<span class=type>function</span>(who<span class=delimiter>,</span> what) {</div><div>  return who + <span class=string>' says '</span> + what;</div><div>});</div><div> </div><div><span class=name>say</span>([<span class=string>'fred'</span><span class=delimiter>,</span> <span class=string>'hello'</span>]);</div><div><span class=comment>// => 'fred says hello'</span></div><div> </div><div><span class=type>var</span> numbers = Promise<span class=delimiter>.</span><span class=support>all</span>([</div><div>  Promise<span class="delimiter method">.</span><span class=name>resolve</span>(<span class=numeric>40</span>)<span class=delimiter>,</span></div><div>  Promise<span class="delimiter method">.</span><span class=name>resolve</span>(<span class=numeric>36</span>)</div><div>]);</div><div> </div><div>numbers<span class="delimiter method">.</span><span class=name>then</span>(_<span class="delimiter method">.</span><span class=name>spread</span>(<span class=type>function</span>(x<span class=delimiter>,</span> y) {</div><div>  return x + y;</div><div>}));</div><div><span class=comment>// => a Promise of 76</span></div></pre></div></div><div><h3 id=throttle><a href=#throttle class="fa fa-link"></a><code>_.throttle(func, [wait=0], [options={}])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10896>source</a> <a href=https://www.npmjs.com/package/lodash.throttle>npm package</a><p>Creates a throttled function that only invokes <code>func</code> at most once per every <code>wait</code> milliseconds. The throttled function comes with a <code>cancel</code> method to cancel delayed <code>func</code> invocations and a <code>flush</code> method to immediately invoke them. Provide <code>options</code> to indicate whether <code>func</code> should be invoked on the leading and/or trailing edge of the <code>wait</code> timeout. The <code>func</code> is invoked with the last arguments provided to the throttled function. Subsequent calls to the throttled function return the result of the last <code>func</code> invocation.<br><br><strong>Note:</strong> If <code>leading</code> and <code>trailing</code> options are <code>true</code>, <code>func</code> is invoked on the trailing edge of the timeout only if the throttled function is invoked more than once during the <code>wait</code> timeout.<br><br>If <code>wait</code> is <code>0</code> and <code>leading</code> is <code>false</code>, <code>func</code> invocation is deferred until to the next tick, similar to <code>setTimeout</code> with a timeout of <code>0</code>.<br><br>See <a href=https://css-tricks.com/debouncing-throttling-explained-examples/ >David Corbacho's article</a> for details over the differences between <a href=#throttle><code>_.throttle</code></a> and <a href=#debounce><code>_.debounce</code></a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to throttle.<li><code>[wait=0]</code> <em>(number)</em>: The number of milliseconds to throttle invocations to.<li><code>[options={}]</code> <em>(Object)</em>: The options object.<li><code>[options.leading=true]</code> <em>(boolean)</em>: Specify invoking on the leading edge of the timeout.<li><code>[options.trailing=true]</code> <em>(boolean)</em>: Specify invoking on the trailing edge of the timeout.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new throttled function.<h4>Example</h4><div class="highlight js"><pre><div><span class=comment>// Avoid excessively updating the position while scrolling.</span></div><div><span class=name>jQuery</span>(<span class=support>window</span>)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'scroll'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>throttle</span>(updatePosition<span class=delimiter>,</span> <span class=numeric>100</span>));</div><div> </div><div><span class=comment>// Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.</span></div><div><span class=type>var</span> throttled = _<span class="delimiter method">.</span><span class=name>throttle</span>(renewToken<span class=delimiter>,</span> <span class=numeric>300000</span><span class=delimiter>,</span> { <span class=string>'trailing'</span>: false });</div><div><span class=name>jQuery</span>(element)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'click'</span><span class=delimiter>,</span> throttled);</div><div> </div><div><span class=comment>// Cancel the trailing throttled invocation.</span></div><div><span class=name>jQuery</span>(<span class=support>window</span>)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'popstate'</span><span class=delimiter>,</span> throttled<span class=delimiter>.</span>cancel);</div></pre></div></div><div><h3 id=unary><a href=#unary class="fa fa-link"></a><code>_.unary(func)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10929>source</a> <a href=https://www.npmjs.com/package/lodash.unary>npm package</a><p>Creates a function that accepts up to one argument, ignoring any additional arguments.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to cap arguments for.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new capped function.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'6'</span><span class=delimiter>,</span> <span class=string>'8'</span><span class=delimiter>,</span> <span class=string>'10'</span>]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>unary</span>(parseInt));</div><div><span class=comment>// => [6, 8, 10]</span></div></pre></div></div><div><h3 id=wrap><a href=#wrap class="fa fa-link"></a><code>_.wrap(value, [wrapper=identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10955>source</a> <a href=https://www.npmjs.com/package/lodash.wrap>npm package</a><p>Creates a function that provides <code>value</code> to <code>wrapper</code> as its first argument. Any additional arguments provided to the function are appended to those provided to the <code>wrapper</code>. The wrapper is invoked with the <code>this</code> binding of the created function.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to wrap.<li><code>[wrapper=identity]</code> <em>(Function)</em>: The wrapper function.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> p = _<span class="delimiter method">.</span><span class=name>wrap</span>(_<span class=delimiter>.</span>escape<span class=delimiter>,</span> <span class=type>function</span>(func<span class=delimiter>,</span> text) {</div><div>  return <span class=string>'&lt;p>'</span> + <span class=name>func</span>(text) + <span class=string>'&lt;/p>'</span>;</div><div>});</div><div> </div><div><span class=name>p</span>(<span class=string>'fred, barney, & pebbles'</span>);</div><div><span class=comment>// => '&lt;p>fred, barney, &ampamp; pebbles&lt;/p>'</span></div></pre></div></div></div><div><h2><code>“Lang” Methods</code></h2><div><h3 id=castArray><a href=#castArray class="fa fa-link"></a><code>_.castArray(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L10994>source</a> <a href=https://www.npmjs.com/package/lodash.castarray>npm package</a><p>Casts <code>value</code> as an array if it's not one.<h4>Since</h4><p>4.4.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the cast array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>castArray</span>(<span class=numeric>1</span>);</div><div><span class=comment>// => [1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>castArray</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> });</div><div><span class=comment>// => [{ 'a': 1 }]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>castArray</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => ['abc']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>castArray</span>(null);</div><div><span class=comment>// => [null]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>castArray</span>(undefined);</div><div><span class=comment>// => [undefined]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>castArray</span>();</div><div><span class=comment>// => []</span></div><div> </div><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>];</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(_<span class="delimiter method">.</span><span class=name>castArray</span>(array) === array);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=clone><a href=#clone class="fa fa-link"></a><code>_.clone(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11028>source</a> <a href=https://www.npmjs.com/package/lodash.clone>npm package</a><p>Creates a shallow clone of <code>value</code>.<br><br><strong>Note:</strong> This method is loosely based on the <a href=https://mdn.io/Structured_clone_algorithm>structured clone algorithm</a> and supports cloning arrays, array buffers, booleans, date objects, maps, numbers, <code>Object</code> objects, regexes, sets, strings, symbols, and typed arrays. The own enumerable properties of <code>arguments</code> objects are cloned as plain objects. An empty object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to clone.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the cloned value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> }];</div><div> </div><div><span class=type>var</span> shallow = _<span class="delimiter method">.</span><span class=name>clone</span>(objects);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(shallow[<span class=numeric>0</span>] === objects[<span class=numeric>0</span>]);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=cloneDeep><a href=#cloneDeep class="fa fa-link"></a><code>_.cloneDeep(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11086>source</a> <a href=https://www.npmjs.com/package/lodash.clonedeep>npm package</a><p>This method is like <a href=#clone><code>_.clone</code></a> except that it recursively clones <code>value</code>.<h4>Since</h4><p>1.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to recursively clone.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the deep cloned value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> }];</div><div> </div><div><span class=type>var</span> deep = _<span class="delimiter method">.</span><span class=name>cloneDeep</span>(objects);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(deep[<span class=numeric>0</span>] === objects[<span class=numeric>0</span>]);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=cloneDeepWith><a href=#cloneDeepWith class="fa fa-link"></a><code>_.cloneDeepWith(value, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11118>source</a> <a href=https://www.npmjs.com/package/lodash.clonedeepwith>npm package</a><p>This method is like <a href=#cloneWith><code>_.cloneWith</code></a> except that it recursively clones <code>value</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to recursively clone.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize cloning.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the deep cloned value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>customizer</span>(value) {</div><div>  if (_<span class="delimiter method">.</span><span class=name>isElement</span>(value)) {</div><div>    return value<span class="delimiter method">.</span><span class=support>cloneNode</span>(true);</div><div>  }</div><div>}</div><div> </div><div><span class=type>var</span> el = _<span class="delimiter method">.</span><span class=name>cloneDeepWith</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span><span class=delimiter>,</span> customizer);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el === <span class=support>document</span><span class=delimiter>.</span><span class=support>body</span>);</div><div><span class=comment>// => false</span></div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el<span class=delimiter>.</span><span class=support>nodeName</span>);</div><div><span class=comment>// => 'BODY'</span></div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el<span class=delimiter>.</span><span class=support>childNodes</span><span class=delimiter>.</span><span class=support>length</span>);</div><div><span class=comment>// => 20</span></div></pre></div></div><div><h3 id=cloneWith><a href=#cloneWith class="fa fa-link"></a><code>_.cloneWith(value, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11063>source</a> <a href=https://www.npmjs.com/package/lodash.clonewith>npm package</a><p>This method is like <a href=#clone><code>_.clone</code></a> except that it accepts <code>customizer</code> which is invoked to produce the cloned value. If <code>customizer</code> returns <code>undefined</code>, cloning is handled by the method instead. The <code>customizer</code> is invoked with up to four arguments; <em>(value [, index|key, object, stack])</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to clone.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize cloning.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the cloned value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>customizer</span>(value) {</div><div>  if (_<span class="delimiter method">.</span><span class=name>isElement</span>(value)) {</div><div>    return value<span class="delimiter method">.</span><span class=support>cloneNode</span>(false);</div><div>  }</div><div>}</div><div> </div><div><span class=type>var</span> el = _<span class="delimiter method">.</span><span class=name>cloneWith</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span><span class=delimiter>,</span> customizer);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el === <span class=support>document</span><span class=delimiter>.</span><span class=support>body</span>);</div><div><span class=comment>// => false</span></div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el<span class=delimiter>.</span><span class=support>nodeName</span>);</div><div><span class=comment>// => 'BODY'</span></div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(el<span class=delimiter>.</span><span class=support>childNodes</span><span class=delimiter>.</span><span class=support>length</span>);</div><div><span class=comment>// => 0</span></div></pre></div></div><div><h3 id=conformsTo><a href=#conformsTo class="fa fa-link"></a><code>_.conformsTo(object, source)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11147>source</a> <a href=https://www.npmjs.com/package/lodash.conformsto>npm package</a><p>Checks if <code>object</code> conforms to <code>source</code> by invoking the predicate properties of <code>source</code> with the corresponding property values of <code>object</code>.<br><br><strong>Note:</strong> This method is equivalent to <a href=#conforms><code>_.conforms</code></a> when <code>source</code> is partially applied.<h4>Since</h4><p>4.14.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.<li><code>source</code> <em>(Object)</em>: The object of property predicates to conform to.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>object</code> conforms, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>conformsTo</span>(object<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=type>function</span>(n) { return n > <span class=numeric>1</span>; } });</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>conformsTo</span>(object<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=type>function</span>(n) { return n > <span class=numeric>2</span>; } });</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=eq><a href=#eq class="fa fa-link"></a><code>_.eq(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11183>source</a> <a href=https://www.npmjs.com/package/lodash.eq>npm package</a><p>Performs a <a href=http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero><code>SameValueZero</code></a> comparison between two values to determine if they are equivalent.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if the values are equivalent, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span> };</div><div><span class=type>var</span> other = { <span class=string>'a'</span>: <span class=numeric>1</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>eq</span>(object<span class=delimiter>,</span> object);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>eq</span>(object<span class=delimiter>,</span> other);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>eq</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>eq</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=support>Object</span>(<span class=string>'a'</span>));</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>eq</span>(NaN<span class=delimiter>,</span> NaN);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=gt><a href=#gt class="fa fa-link"></a><code>_.gt(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11210>source</a> <a href=https://www.npmjs.com/package/lodash.gt>npm package</a><p>Checks if <code>value</code> is greater than <code>other</code>.<h4>Since</h4><p>3.9.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is greater than <code>other</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>gt</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>gt</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>gt</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=gte><a href=#gte class="fa fa-link"></a><code>_.gte(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11235>source</a> <a href=https://www.npmjs.com/package/lodash.gte>npm package</a><p>Checks if <code>value</code> is greater than or equal to <code>other</code>.<h4>Since</h4><p>3.9.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is greater than or equal to <code>other</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>gte</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>gte</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>gte</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isArguments><a href=#isArguments class="fa fa-link"></a><code>_.isArguments(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11257>source</a> <a href=https://www.npmjs.com/package/lodash.isarguments>npm package</a><p>Checks if <code>value</code> is likely an <code>arguments</code> object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an <code>arguments</code> object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isArguments</span>(<span class=type>function</span>() { return arguments; }());</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArguments</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isArray><a href=#isArray class="fa fa-link"></a><code>_.isArray(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11285>source</a> <a href=https://www.npmjs.com/package/lodash.isarray>npm package</a><p>Checks if <code>value</code> is classified as an <code>Array</code> object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an array, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isArray</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArray</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span><span class=delimiter>.</span>children);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArray</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArray</span>(_<span class=delimiter>.</span>noop);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isArrayBuffer><a href=#isArrayBuffer class="fa fa-link"></a><code>_.isArrayBuffer(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11304>source</a> <a href=https://www.npmjs.com/package/lodash.isarraybuffer>npm package</a><p>Checks if <code>value</code> is classified as an <code>ArrayBuffer</code> object.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an array buffer, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isArrayBuffer</span>(new <span class="name type">ArrayBuffer</span>(<span class=numeric>2</span>));</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayBuffer</span>(new <span class="name type">Array</span>(<span class=numeric>2</span>));</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isArrayLike><a href=#isArrayLike class="fa fa-link"></a><code>_.isArrayLike(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11331>source</a> <a href=https://www.npmjs.com/package/lodash.isarraylike>npm package</a><p>Checks if <code>value</code> is array-like. A value is considered array-like if it's not a function and has a <code>value.length</code> that's an integer greater than or equal to <code>0</code> and less than or equal to <code>Number.MAX_SAFE_INTEGER</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is array-like, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isArrayLike</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLike</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span><span class=delimiter>.</span>children);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLike</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLike</span>(_<span class=delimiter>.</span>noop);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isArrayLikeObject><a href=#isArrayLikeObject class="fa fa-link"></a><code>_.isArrayLikeObject(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11360>source</a> <a href=https://www.npmjs.com/package/lodash.isarraylikeobject>npm package</a><p>This method is like <a href=#isArrayLike><code>_.isArrayLike</code></a> except that it also checks if <code>value</code> is an object.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an array-like object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isArrayLikeObject</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLikeObject</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span><span class=delimiter>.</span>children);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLikeObject</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArrayLikeObject</span>(_<span class=delimiter>.</span>noop);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isBoolean><a href=#isBoolean class="fa fa-link"></a><code>_.isBoolean(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11381>source</a> <a href=https://www.npmjs.com/package/lodash.isboolean>npm package</a><p>Checks if <code>value</code> is classified as a boolean primitive or object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a boolean, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isBoolean</span>(false);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isBoolean</span>(null);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isBuffer><a href=#isBuffer class="fa fa-link"></a><code>_.isBuffer(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11403>source</a> <a href=https://www.npmjs.com/package/lodash.isbuffer>npm package</a><p>Checks if <code>value</code> is a buffer.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a buffer, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isBuffer</span>(new <span class="name type">Buffer</span>(<span class=numeric>2</span>));</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isBuffer</span>(new <span class="name type">Uint8Array</span>(<span class=numeric>2</span>));</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isDate><a href=#isDate class="fa fa-link"></a><code>_.isDate(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11422>source</a> <a href=https://www.npmjs.com/package/lodash.isdate>npm package</a><p>Checks if <code>value</code> is classified as a <code>Date</code> object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a date object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isDate</span>(new <span class="name type">Date</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isDate</span>(<span class=string>'Mon April 23 2012'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isElement><a href=#isElement class="fa fa-link"></a><code>_.isElement(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11441>source</a> <a href=https://www.npmjs.com/package/lodash.iselement>npm package</a><p>Checks if <code>value</code> is likely a DOM element.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a DOM element, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isElement</span>(<span class=support>document</span><span class=delimiter>.</span><span class=support>body</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isElement</span>(<span class=string>'&lt;body>'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isEmpty><a href=#isEmpty class="fa fa-link"></a><code>_.isEmpty(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11478>source</a> <a href=https://www.npmjs.com/package/lodash.isempty>npm package</a><p>Checks if <code>value</code> is an empty object, collection, map, or set.<br><br>Objects are considered empty if they have no own enumerable string keyed properties.<br><br>Array-like values such as <code>arguments</code> objects, arrays, buffers, strings, or jQuery-like collections are considered empty if they have a <code>length</code> of <code>0</code>. Similarly, maps and sets are considered empty if they have a <code>size</code> of <code>0</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is empty, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isEmpty</span>(null);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEmpty</span>(true);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEmpty</span>(<span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEmpty</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEmpty</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> });</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isEqual><a href=#isEqual class="fa fa-link"></a><code>_.isEqual(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11530>source</a> <a href=https://www.npmjs.com/package/lodash.isequal>npm package</a><p>Performs a deep comparison between two values to determine if they are equivalent.<br><br><strong>Note:</strong> This method supports comparing arrays, array buffers, booleans, date objects, error objects, maps, numbers, <code>Object</code> objects, regexes, sets, strings, symbols, and typed arrays. <code>Object</code> objects are compared by their own, not inherited, enumerable properties. Functions and DOM nodes are <strong>not</strong> supported.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if the values are equivalent, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span> };</div><div><span class=type>var</span> other = { <span class=string>'a'</span>: <span class=numeric>1</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEqual</span>(object<span class=delimiter>,</span> other);</div><div><span class=comment>// => true</span></div><div> </div><div>object === other;</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isEqualWith><a href=#isEqualWith class="fa fa-link"></a><code>_.isEqualWith(value, other, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11566>source</a> <a href=https://www.npmjs.com/package/lodash.isequalwith>npm package</a><p>This method is like <a href=#isEqual><code>_.isEqual</code></a> except that it accepts <code>customizer</code> which is invoked to compare values. If <code>customizer</code> returns <code>undefined</code>, comparisons are handled by the method instead. The <code>customizer</code> is invoked with up to six arguments: <em>(objValue, othValue [, index|key, object, other, stack])</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize comparisons.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if the values are equivalent, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>isGreeting</span>(value) {</div><div>  return<span class=string> /^h(?:i|ello)$/</span><span class="delimiter method">.</span><span class=support>test</span>(value);</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>customizer</span>(objValue<span class=delimiter>,</span> othValue) {</div><div>  if (<span class=name>isGreeting</span>(objValue) && <span class=name>isGreeting</span>(othValue)) {</div><div>    return true;</div><div>  }</div><div>}</div><div> </div><div><span class=type>var</span> array = [<span class=string>'hello'</span><span class=delimiter>,</span> <span class=string>'goodbye'</span>];</div><div><span class=type>var</span> other = [<span class=string>'hi'</span><span class=delimiter>,</span> <span class=string>'goodbye'</span>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isEqualWith</span>(array<span class=delimiter>,</span> other<span class=delimiter>,</span> customizer);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=isError><a href=#isError class="fa fa-link"></a><code>_.isError(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11590>source</a> <a href=https://www.npmjs.com/package/lodash.iserror>npm package</a><p>Checks if <code>value</code> is an <code>Error</code>, <code>EvalError</code>, <code>RangeError</code>, <code>ReferenceError</code>, <code>SyntaxError</code>, <code>TypeError</code>, or <code>URIError</code> object.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an error object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isError</span>(new <span class="name type">Error</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isError</span>(Error);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isFinite><a href=#isFinite class="fa fa-link"></a><code>_.isFinite(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11625>source</a> <a href=https://www.npmjs.com/package/lodash.isfinite>npm package</a><p>Checks if <code>value</code> is a finite primitive number.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/Number/isFinite><code>Number.isFinite</code></a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a finite number, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isFinite</span>(<span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isFinite</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isFinite</span>(Infinity);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isFinite</span>(<span class=string>'3'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isFunction><a href=#isFunction class="fa fa-link"></a><code>_.isFunction(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11646>source</a> <a href=https://www.npmjs.com/package/lodash.isfunction>npm package</a><p>Checks if <code>value</code> is classified as a <code>Function</code> object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a function, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isFunction</span>(_);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isFunction</span>(<span class=string>/abc/</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isInteger><a href=#isInteger class="fa fa-link"></a><code>_.isInteger(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11682>source</a> <a href=https://www.npmjs.com/package/lodash.isinteger>npm package</a><p>Checks if <code>value</code> is an integer.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/Number/isInteger><code>Number.isInteger</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an integer, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isInteger</span>(<span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isInteger</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isInteger</span>(Infinity);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isInteger</span>(<span class=string>'3'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isLength><a href=#isLength class="fa fa-link"></a><code>_.isLength(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11712>source</a> <a href=https://www.npmjs.com/package/lodash.islength>npm package</a><p>Checks if <code>value</code> is a valid array-like length.<br><br><strong>Note:</strong> This method is loosely based on <a href=http://ecma-international.org/ecma-262/7.0/#sec-tolength><code>ToLength</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a valid length, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isLength</span>(<span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isLength</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isLength</span>(Infinity);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isLength</span>(<span class=string>'3'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isMap><a href=#isMap class="fa fa-link"></a><code>_.isMap(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11792>source</a> <a href=https://www.npmjs.com/package/lodash.ismap>npm package</a><p>Checks if <code>value</code> is classified as a <code>Map</code> object.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a map, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class=delimiter>.</span><span class=support>isMap</span>(new <span class="name type">Map</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class=delimiter>.</span><span class=support>isMap</span>(new <span class="name type">WeakMap</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isMatch><a href=#isMatch class="fa fa-link"></a><code>_.isMatch(object, source)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11822>source</a> <a href=https://www.npmjs.com/package/lodash.ismatch>npm package</a><p>Performs a partial deep comparison between <code>object</code> and <code>source</code> to determine if <code>object</code> contains equivalent property values.<br><br><strong>Note:</strong> This method is equivalent to <a href=#matches><code>_.matches</code></a> when <code>source</code> is partially applied.<br><br>Partial comparisons will match empty array and empty object <code>source</code> values against any array or object value, respectively. See <a href=#isEqual><code>_.isEqual</code></a> for a list of supported value comparisons.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.<li><code>source</code> <em>(Object)</em>: The object of property values to match.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>object</code> is a match, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isMatch</span>(object<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> });</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isMatch</span>(object<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>1</span> });</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isMatchWith><a href=#isMatchWith class="fa fa-link"></a><code>_.isMatchWith(object, source, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11858>source</a> <a href=https://www.npmjs.com/package/lodash.ismatchwith>npm package</a><p>This method is like <a href=#isMatch><code>_.isMatch</code></a> except that it accepts <code>customizer</code> which is invoked to compare values. If <code>customizer</code> returns <code>undefined</code>, comparisons are handled by the method instead. The <code>customizer</code> is invoked with five arguments: <em>(objValue, srcValue, index|key, object, source)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.<li><code>source</code> <em>(Object)</em>: The object of property values to match.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize comparisons.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>object</code> is a match, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>isGreeting</span>(value) {</div><div>  return<span class=string> /^h(?:i|ello)$/</span><span class="delimiter method">.</span><span class=support>test</span>(value);</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>customizer</span>(objValue<span class=delimiter>,</span> srcValue) {</div><div>  if (<span class=name>isGreeting</span>(objValue) && <span class=name>isGreeting</span>(srcValue)) {</div><div>    return true;</div><div>  }</div><div>}</div><div> </div><div><span class=type>var</span> object = { <span class=string>'greeting'</span>: <span class=string>'hello'</span> };</div><div><span class=type>var</span> source = { <span class=string>'greeting'</span>: <span class=string>'hi'</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isMatchWith</span>(object<span class=delimiter>,</span> source<span class=delimiter>,</span> customizer);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=isNaN><a href=#isNaN class="fa fa-link"></a><code>_.isNaN(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11891>source</a> <a href=https://www.npmjs.com/package/lodash.isnan>npm package</a><p>Checks if <code>value</code> is <code>NaN</code>.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/Number/isNaN><code>Number.isNaN</code></a> and is not the same as global <a href=https://mdn.io/isNaN><code>isNaN</code></a> which returns <code>true</code> for <code>undefined</code> and other non-number values.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is <code>NaN</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isNaN</span>(NaN);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNaN</span>(new <span class="name type">Number</span>(NaN));</div><div><span class=comment>// => true</span></div><div> </div><div><span class=support>isNaN</span>(undefined);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNaN</span>(undefined);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isNative><a href=#isNative class="fa fa-link"></a><code>_.isNative(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11924>source</a> <a href=https://www.npmjs.com/package/lodash.isnative>npm package</a><p>Checks if <code>value</code> is a pristine native function.<br><br><strong>Note:</strong> This method can't reliably detect native functions in the presence of the core-js package because core-js circumvents this kind of detection. Despite multiple requests, the core-js maintainer has made it clear: any attempt to fix the detection will be obstructed. As a result, we're left with little choice but to throw an error. Unfortunately, this also affects packages, like <a href=https://www.npmjs.com/package/babel-polyfill>babel-polyfill</a>, which rely on core-js.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a native function, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isNative</span>(<span class=support>Array</span><span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>push);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNative</span>(_);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isNil><a href=#isNil class="fa fa-link"></a><code>_.isNil(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11972>source</a> <a href=https://www.npmjs.com/package/lodash.isnil>npm package</a><p>Checks if <code>value</code> is <code>null</code> or <code>undefined</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is nullish, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isNil</span>(null);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNil</span>(void <span class=numeric>0</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNil</span>(NaN);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isNull><a href=#isNull class="fa fa-link"></a><code>_.isNull(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11948>source</a> <a href=https://www.npmjs.com/package/lodash.isnull>npm package</a><p>Checks if <code>value</code> is <code>null</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is <code>null</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isNull</span>(null);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNull</span>(void <span class=numeric>0</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isNumber><a href=#isNumber class="fa fa-link"></a><code>_.isNumber(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12002>source</a> <a href=https://www.npmjs.com/package/lodash.isnumber>npm package</a><p>Checks if <code>value</code> is classified as a <code>Number</code> primitive or object.<br><br><strong>Note:</strong> To exclude <code>Infinity</code>, <code>-Infinity</code>, and <code>NaN</code>, which are classified as numbers, use the <a href=#isFinite><code>_.isFinite</code></a> method.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a number, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isNumber</span>(<span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNumber</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNumber</span>(Infinity);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isNumber</span>(<span class=string>'3'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isObject><a href=#isObject class="fa fa-link"></a><code>_.isObject(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11742>source</a> <a href=https://www.npmjs.com/package/lodash.isobject>npm package</a><p>Checks if <code>value</code> is the <a href=http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types>language type</a> of <code>Object</code>. <em>(e.g. arrays, functions, objects, regexes, <code>new Number(0)</code>, and <code>new String('')</code>)</em><h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is an object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isObject</span>({});</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObject</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObject</span>(_<span class=delimiter>.</span>noop);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObject</span>(null);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isObjectLike><a href=#isObjectLike class="fa fa-link"></a><code>_.isObjectLike(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L11771>source</a> <a href=https://www.npmjs.com/package/lodash.isobjectlike>npm package</a><p>Checks if <code>value</code> is object-like. A value is object-like if it's not <code>null</code> and has a <code>typeof</code> result of "object".<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is object-like, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isObjectLike</span>({});</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObjectLike</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObjectLike</span>(_<span class=delimiter>.</span>noop);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isObjectLike</span>(null);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isPlainObject><a href=#isPlainObject class="fa fa-link"></a><code>_.isPlainObject(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12035>source</a> <a href=https://www.npmjs.com/package/lodash.isplainobject>npm package</a><p>Checks if <code>value</code> is a plain object, that is, an object created by the <code>Object</code> constructor or one with a <code>[[Prototype]]</code> of <code>null</code>.<h4>Since</h4><p>0.8.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a plain object, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isPlainObject</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isPlainObject</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isPlainObject</span>({ <span class=string>'x'</span>: <span class=numeric>0</span><span class=delimiter>,</span> <span class=string>'y'</span>: <span class=numeric>0</span> });</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isPlainObject</span>(<span class=support>Object</span><span class="delimiter method">.</span><span class=name>create</span>(null));</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=isRegExp><a href=#isRegExp class="fa fa-link"></a><code>_.isRegExp(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12065>source</a> <a href=https://www.npmjs.com/package/lodash.isregexp>npm package</a><p>Checks if <code>value</code> is classified as a <code>RegExp</code> object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a regexp, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isRegExp</span>(<span class=string>/abc/</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isRegExp</span>(<span class=string>'/abc/'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isSafeInteger><a href=#isSafeInteger class="fa fa-link"></a><code>_.isSafeInteger(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12094>source</a> <a href=https://www.npmjs.com/package/lodash.issafeinteger>npm package</a><p>Checks if <code>value</code> is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/Number/isSafeInteger><code>Number.isSafeInteger</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a safe integer, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isSafeInteger</span>(<span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isSafeInteger</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isSafeInteger</span>(Infinity);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isSafeInteger</span>(<span class=string>'3'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isSet><a href=#isSet class="fa fa-link"></a><code>_.isSet(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12115>source</a> <a href=https://www.npmjs.com/package/lodash.isset>npm package</a><p>Checks if <code>value</code> is classified as a <code>Set</code> object.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a set, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isSet</span>(new <span class="name type">Set</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isSet</span>(new <span class="name type">WeakSet</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isString><a href=#isString class="fa fa-link"></a><code>_.isString(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12134>source</a> <a href=https://www.npmjs.com/package/lodash.isstring>npm package</a><p>Checks if <code>value</code> is classified as a <code>String</code> primitive or object.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a string, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isString</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isString</span>(<span class=numeric>1</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isSymbol><a href=#isSymbol class="fa fa-link"></a><code>_.isSymbol(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12156>source</a> <a href=https://www.npmjs.com/package/lodash.issymbol>npm package</a><p>Checks if <code>value</code> is classified as a <code>Symbol</code> primitive or object.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a symbol, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isSymbol</span>(<span class=support>Symbol</span><span class=delimiter>.</span>iterator);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isSymbol</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isTypedArray><a href=#isTypedArray class="fa fa-link"></a><code>_.isTypedArray(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12178>source</a> <a href=https://www.npmjs.com/package/lodash.istypedarray>npm package</a><p>Checks if <code>value</code> is classified as a typed array.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a typed array, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isTypedArray</span>(new <span class="name type">Uint8Array</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isTypedArray</span>([]);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isUndefined><a href=#isUndefined class="fa fa-link"></a><code>_.isUndefined(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12197>source</a> <a href=https://www.npmjs.com/package/lodash.isundefined>npm package</a><p>Checks if <code>value</code> is <code>undefined</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is <code>undefined</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isUndefined</span>(void <span class=numeric>0</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isUndefined</span>(null);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isWeakMap><a href=#isWeakMap class="fa fa-link"></a><code>_.isWeakMap(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12218>source</a> <a href=https://www.npmjs.com/package/lodash.isweakmap>npm package</a><p>Checks if <code>value</code> is classified as a <code>WeakMap</code> object.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a weak map, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isWeakMap</span>(new <span class="name type">WeakMap</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isWeakMap</span>(new <span class="name type">Map</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=isWeakSet><a href=#isWeakSet class="fa fa-link"></a><code>_.isWeakSet(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12239>source</a> <a href=https://www.npmjs.com/package/lodash.isweakset>npm package</a><p>Checks if <code>value</code> is classified as a <code>WeakSet</code> object.<h4>Since</h4><p>4.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is a weak set, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>isWeakSet</span>(new <span class="name type">WeakSet</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isWeakSet</span>(new <span class="name type">Set</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=lt><a href=#lt class="fa fa-link"></a><code>_.lt(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12266>source</a> <a href=https://www.npmjs.com/package/lodash.lt>npm package</a><p>Checks if <code>value</code> is less than <code>other</code>.<h4>Since</h4><p>3.9.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is less than <code>other</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>lt</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lt</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lt</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=lte><a href=#lte class="fa fa-link"></a><code>_.lte(value, other)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12291>source</a> <a href=https://www.npmjs.com/package/lodash.lte>npm package</a><p>Checks if <code>value</code> is less than or equal to <code>other</code>.<h4>Since</h4><p>3.9.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to compare.<li><code>other</code> <em>(*)</em>: The other value to compare.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>value</code> is less than or equal to <code>other</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>lte</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lte</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lte</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=toArray><a href=#toArray class="fa fa-link"></a><code>_.toArray(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12318>source</a> <a href=https://www.npmjs.com/package/lodash.toarray>npm package</a><p>Converts <code>value</code> to an array.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the converted array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toArray</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> });</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toArray</span>(<span class=string>'abc'</span>);</div><div><span class=comment>// => ['a', 'b', 'c']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toArray</span>(<span class=numeric>1</span>);</div><div><span class=comment>// => []</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toArray</span>(null);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=toFinite><a href=#toFinite class="fa fa-link"></a><code>_.toFinite(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12357>source</a> <a href=https://www.npmjs.com/package/lodash.tofinite>npm package</a><p>Converts <code>value</code> to a finite number.<h4>Since</h4><p>4.12.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the converted number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toFinite</span>(<span class=numeric>3<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => 3.2</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toFinite</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => 5e-324</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toFinite</span>(Infinity);</div><div><span class=comment>// => 1.7976931348623157e+308</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toFinite</span>(<span class=string>'3.2'</span>);</div><div><span class=comment>// => 3.2</span></div></pre></div></div><div><h3 id=toInteger><a href=#toInteger class="fa fa-link"></a><code>_.toInteger(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12395>source</a> <a href=https://www.npmjs.com/package/lodash.tointeger>npm package</a><p>Converts <code>value</code> to an integer.<br><br><strong>Note:</strong> This method is loosely based on <a href=http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger><code>ToInteger</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the converted integer.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toInteger</span>(<span class=numeric>3<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toInteger</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => 0</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toInteger</span>(Infinity);</div><div><span class=comment>// => 1.7976931348623157e+308</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toInteger</span>(<span class=string>'3.2'</span>);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=toLength><a href=#toLength class="fa fa-link"></a><code>_.toLength(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12429>source</a> <a href=https://www.npmjs.com/package/lodash.tolength>npm package</a><p>Converts <code>value</code> to an integer suitable for use as the length of an array-like object.<br><br><strong>Note:</strong> This method is based on <a href=http://ecma-international.org/ecma-262/7.0/#sec-tolength><code>ToLength</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the converted integer.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toLength</span>(<span class=numeric>3<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toLength</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => 0</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toLength</span>(Infinity);</div><div><span class=comment>// => 4294967295</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toLength</span>(<span class=string>'3.2'</span>);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=toNumber><a href=#toNumber class="fa fa-link"></a><code>_.toNumber(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12456>source</a> <a href=https://www.npmjs.com/package/lodash.tonumber>npm package</a><p>Converts <code>value</code> to a number.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to process.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toNumber</span>(<span class=numeric>3<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => 3.2</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toNumber</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => 5e-324</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toNumber</span>(Infinity);</div><div><span class=comment>// => Infinity</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toNumber</span>(<span class=string>'3.2'</span>);</div><div><span class=comment>// => 3.2</span></div></pre></div></div><div><h3 id=toPlainObject><a href=#toPlainObject class="fa fa-link"></a><code>_.toPlainObject(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12501>source</a> <a href=https://www.npmjs.com/package/lodash.toplainobject>npm package</a><p>Converts <code>value</code> to a plain object flattening inherited enumerable string keyed properties of <code>value</code> to own properties of the plain object.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the converted plain object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>assign</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> new <span class="name type">Foo</span>);</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>assign</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>toPlainObject</span>(new <span class="name type">Foo</span>));</div><div><span class=comment>// => { 'a': 1, 'b': 2, 'c': 3 }</span></div></pre></div></div><div><h3 id=toSafeInteger><a href=#toSafeInteger class="fa fa-link"></a><code>_.toSafeInteger(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12529>source</a> <a href=https://www.npmjs.com/package/lodash.tosafeinteger>npm package</a><p>Converts <code>value</code> to a safe integer. A safe integer can be compared and represented correctly.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the converted integer.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toSafeInteger</span>(<span class=numeric>3<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toSafeInteger</span>(<span class=support>Number</span><span class=delimiter>.</span><span class=support>MIN_VALUE</span>);</div><div><span class=comment>// => 0</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toSafeInteger</span>(Infinity);</div><div><span class=comment>// => 9007199254740991</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toSafeInteger</span>(<span class=string>'3.2'</span>);</div><div><span class=comment>// => 3</span></div></pre></div></div><div><h3 id=toString><a href=#toString class="fa fa-link"></a><code>_.toString(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12554>source</a> <a href=https://www.npmjs.com/package/lodash.tostring>npm package</a><p>Converts <code>value</code> to a string. An empty string is returned for <code>null</code> and <code>undefined</code> values. The sign of <code>-0</code> is preserved.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the converted string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>toString</span>(null);</div><div><span class=comment>// => ''</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=support>toString</span>(-<span class=numeric>0</span>);</div><div><span class=comment>// => '-0'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=support>toString</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div><span class=comment>// => '1,2,3'</span></div></pre></div></div></div><div><h2><code>“Math” Methods</code></h2><div><h3 id=add><a href=#add class="fa fa-link"></a><code>_.add(augend, addend)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16145>source</a> <a href=https://www.npmjs.com/package/lodash.add>npm package</a><p>Adds two numbers.<h4>Since</h4><p>3.4.0<h4>Arguments</h4><ol><li><code>augend</code> <em>(number)</em>: The first number in an addition.<li><code>addend</code> <em>(number)</em>: The second number in an addition.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the total.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>add</span>(<span class=numeric>6</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => 10</span></div></pre></div></div><div><h3 id=ceil><a href=#ceil class="fa fa-link"></a><code>_.ceil(number, [precision=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16170>source</a> <a href=https://www.npmjs.com/package/lodash.ceil>npm package</a><p>Computes <code>number</code> rounded up to <code>precision</code>.<h4>Since</h4><p>3.10.0<h4>Arguments</h4><ol><li><code>number</code> <em>(number)</em>: The number to round up.<li><code>[precision=0]</code> <em>(number)</em>: The precision to round up to.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the rounded up number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>ceil</span>(<span class=numeric>4<span class=delimiter>.</span>006</span>);</div><div><span class=comment>// => 5</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>ceil</span>(<span class=numeric>6<span class=delimiter>.</span>004</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 6.01</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>ceil</span>(<span class=numeric>6040</span><span class=delimiter>,</span> -<span class=numeric>2</span>);</div><div><span class=comment>// => 6100</span></div></pre></div></div><div><h3 id=divide><a href=#divide class="fa fa-link"></a><code>_.divide(dividend, divisor)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16187>source</a> <a href=https://www.npmjs.com/package/lodash.divide>npm package</a><p>Divide two numbers.<h4>Since</h4><p>4.7.0<h4>Arguments</h4><ol><li><code>dividend</code> <em>(number)</em>: The first number in a division.<li><code>divisor</code> <em>(number)</em>: The second number in a division.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the quotient.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>divide</span>(<span class=numeric>6</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => 1.5</span></div></pre></div></div><div><h3 id=floor><a href=#floor class="fa fa-link"></a><code>_.floor(number, [precision=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16212>source</a> <a href=https://www.npmjs.com/package/lodash.floor>npm package</a><p>Computes <code>number</code> rounded down to <code>precision</code>.<h4>Since</h4><p>3.10.0<h4>Arguments</h4><ol><li><code>number</code> <em>(number)</em>: The number to round down.<li><code>[precision=0]</code> <em>(number)</em>: The precision to round down to.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the rounded down number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>floor</span>(<span class=numeric>4<span class=delimiter>.</span>006</span>);</div><div><span class=comment>// => 4</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>floor</span>(<span class=numeric>0<span class=delimiter>.</span>046</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 0.04</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>floor</span>(<span class=numeric>4060</span><span class=delimiter>,</span> -<span class=numeric>2</span>);</div><div><span class=comment>// => 4000</span></div></pre></div></div><div><h3 id=max><a href=#max class="fa fa-link"></a><code>_.max(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16232>source</a> <a href=https://www.npmjs.com/package/lodash.max>npm package</a><p>Computes the maximum value of <code>array</code>. If <code>array</code> is empty or falsey, <code>undefined</code> is returned.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the maximum value.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>max</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=numeric>6</span>]);</div><div><span class=comment>// => 8</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>max</span>([]);</div><div><span class=comment>// => undefined</span></div></pre></div></div><div><h3 id=maxBy><a href=#maxBy class="fa fa-link"></a><code>_.maxBy(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16261>source</a> <a href=https://www.npmjs.com/package/lodash.maxby>npm package</a><p>This method is like <a href=#max><code>_.max</code></a> except that it accepts <code>iteratee</code> which is invoked for each element in <code>array</code> to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the maximum value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'n'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>maxBy</span>(objects<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>n; });</div><div><span class=comment>// => { 'n': 2 }</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>maxBy</span>(objects<span class=delimiter>,</span> <span class=string>'n'</span>);</div><div><span class=comment>// => { 'n': 2 }</span></div></pre></div></div><div><h3 id=mean><a href=#mean class="fa fa-link"></a><code>_.mean(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16281>source</a> <a href=https://www.npmjs.com/package/lodash.mean>npm package</a><p>Computes the mean of the values in <code>array</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the mean.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>mean</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=numeric>6</span>]);</div><div><span class=comment>// => 5</span></div></pre></div></div><div><h3 id=meanBy><a href=#meanBy class="fa fa-link"></a><code>_.meanBy(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16308>source</a> <a href=https://www.npmjs.com/package/lodash.meanby>npm package</a><p>This method is like <a href=#mean><code>_.mean</code></a> except that it accepts <code>iteratee</code> which is invoked for each element in <code>array</code> to generate the value to be averaged. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.7.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the mean.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'n'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>8</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>6</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>meanBy</span>(objects<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>n; });</div><div><span class=comment>// => 5</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>meanBy</span>(objects<span class=delimiter>,</span> <span class=string>'n'</span>);</div><div><span class=comment>// => 5</span></div></pre></div></div><div><h3 id=min><a href=#min class="fa fa-link"></a><code>_.min(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16330>source</a> <a href=https://www.npmjs.com/package/lodash.min>npm package</a><p>Computes the minimum value of <code>array</code>. If <code>array</code> is empty or falsey, <code>undefined</code> is returned.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the minimum value.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>min</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=numeric>6</span>]);</div><div><span class=comment>// => 2</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>min</span>([]);</div><div><span class=comment>// => undefined</span></div></pre></div></div><div><h3 id=minBy><a href=#minBy class="fa fa-link"></a><code>_.minBy(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16359>source</a> <a href=https://www.npmjs.com/package/lodash.minby>npm package</a><p>This method is like <a href=#min><code>_.min</code></a> except that it accepts <code>iteratee</code> which is invoked for each element in <code>array</code> to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the minimum value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'n'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>2</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>minBy</span>(objects<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>n; });</div><div><span class=comment>// => { 'n': 1 }</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>minBy</span>(objects<span class=delimiter>,</span> <span class=string>'n'</span>);</div><div><span class=comment>// => { 'n': 1 }</span></div></pre></div></div><div><h3 id=multiply><a href=#multiply class="fa fa-link"></a><code>_.multiply(multiplier, multiplicand)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16380>source</a> <a href=https://www.npmjs.com/package/lodash.multiply>npm package</a><p>Multiply two numbers.<h4>Since</h4><p>4.7.0<h4>Arguments</h4><ol><li><code>multiplier</code> <em>(number)</em>: The first number in a multiplication.<li><code>multiplicand</code> <em>(number)</em>: The second number in a multiplication.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the product.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>multiply</span>(<span class=numeric>6</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => 24</span></div></pre></div></div><div><h3 id=round><a href=#round class="fa fa-link"></a><code>_.round(number, [precision=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16405>source</a> <a href=https://www.npmjs.com/package/lodash.round>npm package</a><p>Computes <code>number</code> rounded to <code>precision</code>.<h4>Since</h4><p>3.10.0<h4>Arguments</h4><ol><li><code>number</code> <em>(number)</em>: The number to round.<li><code>[precision=0]</code> <em>(number)</em>: The precision to round to.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the rounded number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>round</span>(<span class=numeric>4<span class=delimiter>.</span>006</span>);</div><div><span class=comment>// => 4</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>round</span>(<span class=numeric>4<span class=delimiter>.</span>006</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 4.01</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>round</span>(<span class=numeric>4060</span><span class=delimiter>,</span> -<span class=numeric>2</span>);</div><div><span class=comment>// => 4100</span></div></pre></div></div><div><h3 id=subtract><a href=#subtract class="fa fa-link"></a><code>_.subtract(minuend, subtrahend)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16422>source</a> <a href=https://www.npmjs.com/package/lodash.subtract>npm package</a><p>Subtract two numbers.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>minuend</code> <em>(number)</em>: The first number in a subtraction.<li><code>subtrahend</code> <em>(number)</em>: The second number in a subtraction.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the difference.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>subtract</span>(<span class=numeric>6</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => 2</span></div></pre></div></div><div><h3 id=sum><a href=#sum class="fa fa-link"></a><code>_.sum(array)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16440>source</a> <a href=https://www.npmjs.com/package/lodash.sum>npm package</a><p>Computes the sum of the values in <code>array</code>.<h4>Since</h4><p>3.4.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the sum.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>sum</span>([<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=numeric>6</span>]);</div><div><span class=comment>// => 20</span></div></pre></div></div><div><h3 id=sumBy><a href=#sumBy class="fa fa-link"></a><code>_.sumBy(array, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16469>source</a> <a href=https://www.npmjs.com/package/lodash.sumby>npm package</a><p>This method is like <a href=#sum><code>_.sum</code></a> except that it accepts <code>iteratee</code> which is invoked for each element in <code>array</code> to generate the value to be summed. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>array</code> <em>(Array)</em>: The array to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the sum.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [{ <span class=string>'n'</span>: <span class=numeric>4</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>8</span> }<span class=delimiter>,</span> { <span class=string>'n'</span>: <span class=numeric>6</span> }];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>sumBy</span>(objects<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>n; });</div><div><span class=comment>// => 20</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>sumBy</span>(objects<span class=delimiter>,</span> <span class=string>'n'</span>);</div><div><span class=comment>// => 20</span></div></pre></div></div></div><div><h2><code>“Number” Methods</code></h2><div><h3 id=clamp><a href=#clamp class="fa fa-link"></a><code>_.clamp(number, [lower], upper)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13942>source</a> <a href=https://www.npmjs.com/package/lodash.clamp>npm package</a><p>Clamps <code>number</code> within the inclusive <code>lower</code> and <code>upper</code> bounds.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>number</code> <em>(number)</em>: The number to clamp.<li><code>[lower]</code> <em>(number)</em>: The lower bound.<li><code>upper</code> <em>(number)</em>: The upper bound.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the clamped number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>clamp</span>(-<span class=numeric>10</span><span class=delimiter>,</span> -<span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => -5</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>clamp</span>(<span class=numeric>10</span><span class=delimiter>,</span> -<span class=numeric>5</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => 5</span></div></pre></div></div><div><h3 id=inRange><a href=#inRange class="fa fa-link"></a><code>_.inRange(number, [start=0], end)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13996>source</a> <a href=https://www.npmjs.com/package/lodash.inrange>npm package</a><p>Checks if <code>n</code> is between <code>start</code> and up to, but not including, <code>end</code>. If <code>end</code> is not specified, it's set to <code>start</code> with <code>start</code> then set to <code>0</code>. If <code>start</code> is greater than <code>end</code> the params are swapped to support negative ranges.<h4>Since</h4><p>3.3.0<h4>Arguments</h4><ol><li><code>number</code> <em>(number)</em>: The number to check.<li><code>[start=0]</code> <em>(number)</em>: The start of the range.<li><code>end</code> <em>(number)</em>: The end of the range.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>number</code> is in the range, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>8</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>1<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(<span class=numeric>5<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>inRange</span>(-<span class=numeric>3</span><span class=delimiter>,</span> -<span class=numeric>2</span><span class=delimiter>,</span> -<span class=numeric>6</span>);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=random><a href=#random class="fa fa-link"></a><code>_.random([lower=0], [upper=1], [floating])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14039>source</a> <a href=https://www.npmjs.com/package/lodash.random>npm package</a><p>Produces a random number between the inclusive <code>lower</code> and <code>upper</code> bounds. If only one argument is provided a number between <code>0</code> and the given number is returned. If <code>floating</code> is <code>true</code>, or either <code>lower</code> or <code>upper</code> are floats, a floating-point number is returned instead of an integer.<br><br><strong>Note:</strong> JavaScript follows the IEEE-754 standard for resolving floating-point values which can produce unexpected results.<h4>Since</h4><p>0.7.0<h4>Arguments</h4><ol><li><code>[lower=0]</code> <em>(number)</em>: The lower bound.<li><code>[upper=1]</code> <em>(number)</em>: The upper bound.<li><code>[floating]</code> <em>(boolean)</em>: Specify returning a floating-point number.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the random number.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>random</span>(<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => an integer between 0 and 5</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>random</span>(<span class=numeric>5</span>);</div><div><span class=comment>// => also an integer between 0 and 5</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>random</span>(<span class=numeric>5</span><span class=delimiter>,</span> true);</div><div><span class=comment>// => a floating-point number between 0 and 5</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>random</span>(<span class=numeric>1<span class=delimiter>.</span>2</span><span class=delimiter>,</span> <span class=numeric>5<span class=delimiter>.</span>2</span>);</div><div><span class=comment>// => a floating-point number between 1.2 and 5.2</span></div></pre></div></div></div><div><h2><code>“Object” Methods</code></h2><div><h3 id=assign><a href=#assign class="fa fa-link"></a><code>_.assign(object, [sources])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12592>source</a> <a href=https://www.npmjs.com/package/lodash.assign>npm package</a><p>Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.<br><br><strong>Note:</strong> This method mutates <code>object</code> and is loosely based on <a href=https://mdn.io/Object/assign><code>Object.assign</code></a>.<h4>Since</h4><p>0.10.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>[sources]</code> <em>(...Object)</em>: The source objects.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>Bar</span>() {</div><div>  this<span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>Bar<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>d = <span class=numeric>4</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>assign</span>({ <span class=string>'a'</span>: <span class=numeric>0</span> }<span class=delimiter>,</span> new <span class="name type">Foo</span><span class=delimiter>,</span> new <span class="name type">Bar</span>);</div><div><span class=comment>// => { 'a': 1, 'c': 3 }</span></div></pre></div></div><div><h3 id=assignIn><a href=#assignIn class="fa fa-link"></a><code>_.assignIn(object, [sources])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12635>source</a> <a href=https://www.npmjs.com/package/lodash.assignin>npm package</a><p>This method is like <a href=#assign><code>_.assign</code></a> except that it iterates over own and inherited source properties.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Aliases</h4><p><em>_.extend</em><h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>[sources]</code> <em>(...Object)</em>: The source objects.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>Bar</span>() {</div><div>  this<span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>Bar<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>d = <span class=numeric>4</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>assignIn</span>({ <span class=string>'a'</span>: <span class=numeric>0</span> }<span class=delimiter>,</span> new <span class="name type">Foo</span><span class=delimiter>,</span> new <span class="name type">Bar</span>);</div><div><span class=comment>// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }</span></div></pre></div></div><div><h3 id=assignInWith><a href=#assignInWith class="fa fa-link"></a><code>_.assignInWith(object, sources, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12668>source</a> <a href=https://www.npmjs.com/package/lodash.assigninwith>npm package</a><p>This method is like <a href=#assignIn><code>_.assignIn</code></a> except that it accepts <code>customizer</code> which is invoked to produce the assigned values. If <code>customizer</code> returns <code>undefined</code>, assignment is handled by the method instead. The <code>customizer</code> is invoked with five arguments: <em>(objValue, srcValue, key, object, source)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Aliases</h4><p><em>_.extendWith</em><h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>sources</code> <em>(...Object)</em>: The source objects.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize assigned values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>customizer</span>(objValue<span class=delimiter>,</span> srcValue) {</div><div>  return _<span class="delimiter method">.</span><span class=name>isUndefined</span>(objValue) ? srcValue : objValue;</div><div>}</div><div> </div><div><span class=type>var</span> defaults = _<span class="delimiter method">.</span><span class=name>partialRight</span>(_<span class=delimiter>.</span>assignInWith<span class=delimiter>,</span> customizer);</div><div> </div><div><span class=name>defaults</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'a'</span>: <span class=numeric>3</span> });</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div></pre></div></div><div><h3 id=assignWith><a href=#assignWith class="fa fa-link"></a><code>_.assignWith(object, sources, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12700>source</a> <a href=https://www.npmjs.com/package/lodash.assignwith>npm package</a><p>This method is like <a href=#assign><code>_.assign</code></a> except that it accepts <code>customizer</code> which is invoked to produce the assigned values. If <code>customizer</code> returns <code>undefined</code>, assignment is handled by the method instead. The <code>customizer</code> is invoked with five arguments: <em>(objValue, srcValue, key, object, source)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>sources</code> <em>(...Object)</em>: The source objects.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize assigned values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>customizer</span>(objValue<span class=delimiter>,</span> srcValue) {</div><div>  return _<span class="delimiter method">.</span><span class=name>isUndefined</span>(objValue) ? srcValue : objValue;</div><div>}</div><div> </div><div><span class=type>var</span> defaults = _<span class="delimiter method">.</span><span class=name>partialRight</span>(_<span class=delimiter>.</span>assignWith<span class=delimiter>,</span> customizer);</div><div> </div><div><span class=name>defaults</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'a'</span>: <span class=numeric>3</span> });</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div></pre></div></div><div><h3 id=at><a href=#at class="fa fa-link"></a><code>_.at(object, [paths])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12721>source</a> <a href=https://www.npmjs.com/package/lodash.at>npm package</a><p>Creates an array of values corresponding to <code>paths</code> of <code>object</code>.<h4>Since</h4><p>1.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[paths]</code> <em>(...(string|string[]))</em>: The property paths to pick.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the picked values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>3</span> } }<span class=delimiter>,</span> <span class=numeric>4</span>] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>at</span>(object<span class=delimiter>,</span> [<span class=string>'a[0].b.c'</span><span class=delimiter>,</span> <span class=string>'a[1]'</span>]);</div><div><span class=comment>// => [3, 4]</span></div></pre></div></div><div><h3 id=create><a href=#create class="fa fa-link"></a><code>_.create(prototype, [properties])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12757>source</a> <a href=https://www.npmjs.com/package/lodash.create>npm package</a><p>Creates an object that inherits from the <code>prototype</code> object. If a <code>properties</code> object is given, its own enumerable string keyed properties are assigned to the created object.<h4>Since</h4><p>2.3.0<h4>Arguments</h4><ol><li><code>prototype</code> <em>(Object)</em>: The object to inherit from.<li><code>[properties]</code> <em>(Object)</em>: The properties to assign to the object.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Shape</span>() {</div><div>  this<span class=delimiter>.</span><span class=support>x</span> = <span class=numeric>0</span>;</div><div>  this<span class=delimiter>.</span><span class=support>y</span> = <span class=numeric>0</span>;</div><div>}</div><div> </div><div><span class=type>function</span> <span class=name>Circle</span>() {</div><div>  Shape<span class="delimiter method">.</span><span class=support>call</span>(this);</div><div>}</div><div> </div><div>Circle<span class=delimiter>.</span><span class=support>prototype</span> = _<span class="delimiter method">.</span><span class=name>create</span>(Shape<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>,</span> {</div><div>  <span class=string>'constructor'</span>: Circle</div><div>});</div><div> </div><div><span class=type>var</span> circle = new <span class="name type">Circle</span>;</div><div>circle instanceof Circle;</div><div><span class=comment>// => true</span></div><div> </div><div>circle instanceof Shape;</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=defaults><a href=#defaults class="fa fa-link"></a><code>_.defaults(object, [sources])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12783>source</a> <a href=https://www.npmjs.com/package/lodash.defaults>npm package</a><p>Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to <code>undefined</code>. Source objects are applied from left to right. Once a property is set, additional values of the same property are ignored.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>[sources]</code> <em>(...Object)</em>: The source objects.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>defaults</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> { <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'a'</span>: <span class=numeric>3</span> });</div><div><span class=comment>// => { 'a': 1, 'b': 2 }</span></div></pre></div></div><div><h3 id=defaultsDeep><a href=#defaultsDeep class="fa fa-link"></a><code>_.defaultsDeep(object, [sources])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12807>source</a> <a href=https://www.npmjs.com/package/lodash.defaultsdeep>npm package</a><p>This method is like <a href=#defaults><code>_.defaults</code></a> except that it recursively assigns default properties.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>3.10.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>[sources]</code> <em>(...Object)</em>: The source objects.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>defaultsDeep</span>({ <span class=string>'a'</span>: { <span class=string>'b'</span>: <span class=numeric>2</span> } }<span class=delimiter>,</span> { <span class=string>'a'</span>: { <span class=string>'b'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> } });</div><div><span class=comment>// => { 'a': { 'b': 2, 'c': 3 } }</span></div></pre></div></div><div><h3 id=findKey><a href=#findKey class="fa fa-link"></a><code>_.findKey(object, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12847>source</a> <a href=https://www.npmjs.com/package/lodash.findkey>npm package</a><p>This method is like <a href=#find><code>_.find</code></a> except that it returns the key of the first element <code>predicate</code> returns truthy for instead of the element itself.<h4>Since</h4><p>1.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the key of the matched element, else <code>undefined</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = {</div><div>  <span class=string>'barney'</span>:  { <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  <span class=string>'fred'</span>:    { <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  <span class=string>'pebbles'</span>: { <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }</div><div>};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>findKey</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>age &lt; <span class=numeric>40</span>; });</div><div><span class=comment>// => 'barney' (iteration order is not guaranteed)</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findKey</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => 'pebbles'</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findKey</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => 'fred'</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findKey</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => 'barney'</span></div></pre></div></div><div><h3 id=findLastKey><a href=#findLastKey class="fa fa-link"></a><code>_.findLastKey(object, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12886>source</a> <a href=https://www.npmjs.com/package/lodash.findlastkey>npm package</a><p>This method is like <a href=#findKey><code>_.findKey</code></a> except that it iterates over elements of a collection in the opposite order.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the key of the matched element, else <code>undefined</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = {</div><div>  <span class=string>'barney'</span>:  { <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  <span class=string>'fred'</span>:    { <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }<span class=delimiter>,</span></div><div>  <span class=string>'pebbles'</span>: { <span class=string>'age'</span>: <span class=numeric>1</span><span class=delimiter>,</span>  <span class=string>'active'</span>: true }</div><div>};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>findLastKey</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>age &lt; <span class=numeric>40</span>; });</div><div><span class=comment>// => returns 'pebbles' assuming `_.findKey` returns 'barney'</span></div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastKey</span>(users<span class=delimiter>,</span> { <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true });</div><div><span class=comment>// => 'barney'</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastKey</span>(users<span class=delimiter>,</span> [<span class=string>'active'</span><span class=delimiter>,</span> false]);</div><div><span class=comment>// => 'fred'</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>findLastKey</span>(users<span class=delimiter>,</span> <span class=string>'active'</span>);</div><div><span class=comment>// => 'pebbles'</span></div></pre></div></div><div><h3 id=forIn><a href=#forIn class="fa fa-link"></a><code>_.forIn(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12918>source</a> <a href=https://www.npmjs.com/package/lodash.forin>npm package</a><p>Iterates over own and inherited enumerable string keyed properties of an object and invokes <code>iteratee</code> for each property. The iteratee is invoked with three arguments: <em>(value, key, object)</em>. Iteratee functions may exit iteration early by explicitly returning <code>false</code>.<h4>Since</h4><p>0.3.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forIn</span>(new <span class="name type">Foo</span><span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(key);</div><div>});</div><div><span class=comment>// => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).</span></div></pre></div></div><div><h3 id=forInRight><a href=#forInRight class="fa fa-link"></a><code>_.forInRight(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12950>source</a> <a href=https://www.npmjs.com/package/lodash.forinright>npm package</a><p>This method is like <a href=#forIn><code>_.forIn</code></a> except that it iterates over properties of <code>object</code> in the opposite order.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forInRight</span>(new <span class="name type">Foo</span><span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(key);</div><div>});</div><div><span class=comment>// => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.</span></div></pre></div></div><div><h3 id=forOwn><a href=#forOwn class="fa fa-link"></a><code>_.forOwn(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L12984>source</a> <a href=https://www.npmjs.com/package/lodash.forown>npm package</a><p>Iterates over own enumerable string keyed properties of an object and invokes <code>iteratee</code> for each property. The iteratee is invoked with three arguments: <em>(value, key, object)</em>. Iteratee functions may exit iteration early by explicitly returning <code>false</code>.<h4>Since</h4><p>0.3.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forOwn</span>(new <span class="name type">Foo</span><span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(key);</div><div>});</div><div><span class=comment>// => Logs 'a' then 'b' (iteration order is not guaranteed).</span></div></pre></div></div><div><h3 id=forOwnRight><a href=#forOwnRight class="fa fa-link"></a><code>_.forOwnRight(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13014>source</a> <a href=https://www.npmjs.com/package/lodash.forownright>npm package</a><p>This method is like <a href=#forOwn><code>_.forOwn</code></a> except that it iterates over properties of <code>object</code> in the opposite order.<h4>Since</h4><p>2.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>forOwnRight</span>(new <span class="name type">Foo</span><span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(key);</div><div>});</div><div><span class=comment>// => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.</span></div></pre></div></div><div><h3 id=functions><a href=#functions class="fa fa-link"></a><code>_.functions(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13041>source</a> <a href=https://www.npmjs.com/package/lodash.functions>npm package</a><p>Creates an array of function property names from own enumerable properties of <code>object</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the function names.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'a'</span>);</div><div>  this<span class=delimiter>.</span>b = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'b'</span>);</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'c'</span>);</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>functions</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => ['a', 'b']</span></div></pre></div></div><div><h3 id=functionsIn><a href=#functionsIn class="fa fa-link"></a><code>_.functionsIn(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13068>source</a> <a href=https://www.npmjs.com/package/lodash.functionsin>npm package</a><p>Creates an array of function property names from own and inherited enumerable properties of <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to inspect.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the function names.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'a'</span>);</div><div>  this<span class=delimiter>.</span>b = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'b'</span>);</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'c'</span>);</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>functionsIn</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => ['a', 'b', 'c']</span></div></pre></div></div><div><h3 id=get><a href=#get class="fa fa-link"></a><code>_.get(object, path, [defaultValue])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13097>source</a> <a href=https://www.npmjs.com/package/lodash.get>npm package</a><p>Gets the value at <code>path</code> of <code>object</code>. If the resolved value is <code>undefined</code>, the <code>defaultValue</code> is returned in its place.<h4>Since</h4><p>3.7.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>path</code> <em>(Array|string)</em>: The path of the property to get.<li><code>[defaultValue]</code> <em>(*)</em>: The value returned for <code>undefined</code> resolved values.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the resolved value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>3</span> } }] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>get</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c'</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>get</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'0'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span>]);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>get</span>(object<span class=delimiter>,</span> <span class=string>'a.b.c'</span><span class=delimiter>,</span> <span class=string>'default'</span>);</div><div><span class=comment>// => 'default'</span></div></pre></div></div><div><h3 id=has><a href=#has class="fa fa-link"></a><code>_.has(object, path)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13129>source</a> <a href=https://www.npmjs.com/package/lodash.has>npm package</a><p>Checks if <code>path</code> is a direct property of <code>object</code>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>path</code> <em>(Array|string)</em>: The path to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>path</code> exists, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: { <span class=string>'b'</span>: <span class=numeric>2</span> } };</div><div><span class=type>var</span> other = _<span class="delimiter method">.</span><span class=name>create</span>({ <span class=string>'a'</span>: _<span class="delimiter method">.</span><span class=name>create</span>({ <span class=string>'b'</span>: <span class=numeric>2</span> }) });</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>has</span>(object<span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>has</span>(object<span class=delimiter>,</span> <span class=string>'a.b'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>has</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>has</span>(other<span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=hasIn><a href=#hasIn class="fa fa-link"></a><code>_.hasIn(object, path)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13159>source</a> <a href=https://www.npmjs.com/package/lodash.hasin>npm package</a><p>Checks if <code>path</code> is a direct or inherited property of <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>path</code> <em>(Array|string)</em>: The path to check.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>path</code> exists, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = _<span class="delimiter method">.</span><span class=name>create</span>({ <span class=string>'a'</span>: _<span class="delimiter method">.</span><span class=name>create</span>({ <span class=string>'b'</span>: <span class=numeric>2</span> }) });</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>hasIn</span>(object<span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>hasIn</span>(object<span class=delimiter>,</span> <span class=string>'a.b'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>hasIn</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>hasIn</span>(object<span class=delimiter>,</span> <span class=string>'b'</span>);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=invert><a href=#invert class="fa fa-link"></a><code>_.invert(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13181>source</a> <a href=https://www.npmjs.com/package/lodash.invert>npm package</a><p>Creates an object composed of the inverted keys and values of <code>object</code>. If <code>object</code> contains duplicate values, subsequent values overwrite property assignments of previous values.<h4>Since</h4><p>0.7.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to invert.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new inverted object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>1</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>invert</span>(object);</div><div><span class=comment>// => { '1': 'c', '2': 'b' }</span></div></pre></div></div><div><h3 id=invertBy><a href=#invertBy class="fa fa-link"></a><code>_.invertBy(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13211>source</a> <a href=https://www.npmjs.com/package/lodash.invertby>npm package</a><p>This method is like <a href=#invert><code>_.invert</code></a> except that the inverted object is generated from the results of running each element of <code>object</code> thru <code>iteratee</code>. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. The iteratee is invoked with one argument: <em>(value)</em>.<h4>Since</h4><p>4.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to invert.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The iteratee invoked per element.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new inverted object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>1</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>invertBy</span>(object);</div><div><span class=comment>// => { '1': ['a', 'c'], '2': ['b'] }</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>invertBy</span>(object<span class=delimiter>,</span> <span class=type>function</span>(value) {</div><div>  return <span class=string>'group'</span> + value;</div><div>});</div><div><span class=comment>// => { 'group1': ['a', 'c'], 'group2': ['b'] }</span></div></pre></div></div><div><h3 id=invoke><a href=#invoke class="fa fa-link"></a><code>_.invoke(object, path, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13237>source</a> <a href=https://www.npmjs.com/package/lodash.invoke>npm package</a><p>Invokes the method at <code>path</code> of <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>path</code> <em>(Array|string)</em>: The path of the method to invoke.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke the method with.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the result of the invoked method.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>] } }] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>invoke</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c.slice'</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => [2, 3]</span></div></pre></div></div><div><h3 id=keys><a href=#keys class="fa fa-link"></a><code>_.keys(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13267>source</a> <a href=https://www.npmjs.com/package/lodash.keys>npm package</a><p>Creates an array of the own enumerable property names of <code>object</code>.<br><br><strong>Note:</strong> Non-object values are coerced to objects. See the <a href=http://ecma-international.org/ecma-262/7.0/#sec-object.keys>ES spec</a> for more details.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of property names.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>keys</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => ['a', 'b'] (iteration order is not guaranteed)</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>keys</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => ['0', '1']</span></div></pre></div></div><div><h3 id=keysIn><a href=#keysIn class="fa fa-link"></a><code>_.keysIn(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13294>source</a> <a href=https://www.npmjs.com/package/lodash.keysin>npm package</a><p>Creates an array of the own and inherited enumerable property names of <code>object</code>.<br><br><strong>Note:</strong> Non-object values are coerced to objects.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of property names.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>keysIn</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => ['a', 'b', 'c'] (iteration order is not guaranteed)</span></div></pre></div></div><div><h3 id=mapKeys><a href=#mapKeys class="fa fa-link"></a><code>_.mapKeys(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13319>source</a> <a href=https://www.npmjs.com/package/lodash.mapkeys>npm package</a><p>The opposite of <a href=#mapValues><code>_.mapValues</code></a>; this method creates an object with the same values as <code>object</code> and keys generated by running each own enumerable string keyed property of <code>object</code> thru <code>iteratee</code>. The iteratee is invoked with three arguments: <em>(value, key, object)</em>.<h4>Since</h4><p>3.8.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new mapped object.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>mapKeys</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> <span class=type>function</span>(value<span class=delimiter>,</span> key) {</div><div>  return key + value;</div><div>});</div><div><span class=comment>// => { 'a1': 1, 'b2': 2 }</span></div></pre></div></div><div><h3 id=mapValues><a href=#mapValues class="fa fa-link"></a><code>_.mapValues(object, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13357>source</a> <a href=https://www.npmjs.com/package/lodash.mapvalues>npm package</a><p>Creates an object with the same keys as <code>object</code> and values generated by running each own enumerable string keyed property of <code>object</code> thru <code>iteratee</code>. The iteratee is invoked with three arguments:<br><em>(value, key, object)</em>.<h4>Since</h4><p>2.4.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new mapped object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = {</div><div>  <span class=string>'fred'</span>:    { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'age'</span>: <span class=numeric>40</span> }<span class=delimiter>,</span></div><div>  <span class=string>'pebbles'</span>: { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>1</span> }</div><div>};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>mapValues</span>(users<span class=delimiter>,</span> <span class=type>function</span>(o) { return o<span class=delimiter>.</span>age; });</div><div><span class=comment>// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>mapValues</span>(users<span class=delimiter>,</span> <span class=string>'age'</span>);</div><div><span class=comment>// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)</span></div></pre></div></div><div><h3 id=merge><a href=#merge class="fa fa-link"></a><code>_.merge(object, [sources])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13398>source</a> <a href=https://www.npmjs.com/package/lodash.merge>npm package</a><p>This method is like <a href=#assign><code>_.assign</code></a> except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object. Source properties that resolve to <code>undefined</code> are skipped if a destination value exists. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>0.5.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>[sources]</code> <em>(...Object)</em>: The source objects.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = {</div><div>  <span class=string>'a'</span>: [{ <span class=string>'b'</span>: <span class=numeric>2</span> }<span class=delimiter>,</span> { <span class=string>'d'</span>: <span class=numeric>4</span> }]</div><div>};</div><div> </div><div><span class=type>var</span> other = {</div><div>  <span class=string>'a'</span>: [{ <span class=string>'c'</span>: <span class=numeric>3</span> }<span class=delimiter>,</span> { <span class=string>'e'</span>: <span class=numeric>5</span> }]</div><div>};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>merge</span>(object<span class=delimiter>,</span> other);</div><div><span class=comment>// => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }</span></div></pre></div></div><div><h3 id=mergeWith><a href=#mergeWith class="fa fa-link"></a><code>_.mergeWith(object, sources, customizer)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13433>source</a> <a href=https://www.npmjs.com/package/lodash.mergewith>npm package</a><p>This method is like <a href=#merge><code>_.merge</code></a> except that it accepts <code>customizer</code> which is invoked to produce the merged values of the destination and source properties. If <code>customizer</code> returns <code>undefined</code>, merging is handled by the method instead. The <code>customizer</code> is invoked with six arguments:<br><em>(objValue, srcValue, key, object, source, stack)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The destination object.<li><code>sources</code> <em>(...Object)</em>: The source objects.<li><code>customizer</code> <em>(Function)</em>: The function to customize assigned values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>customizer</span>(objValue<span class=delimiter>,</span> srcValue) {</div><div>  if (_<span class="delimiter method">.</span><span class=name>isArray</span>(objValue)) {</div><div>    return objValue<span class="delimiter method">.</span><span class=support>concat</span>(srcValue);</div><div>  }</div><div>}</div><div> </div><div><span class=type>var</span> object = { <span class=string>'a'</span>: [<span class=numeric>1</span>]<span class=delimiter>,</span> <span class=string>'b'</span>: [<span class=numeric>2</span>] };</div><div><span class=type>var</span> other = { <span class=string>'a'</span>: [<span class=numeric>3</span>]<span class=delimiter>,</span> <span class=string>'b'</span>: [<span class=numeric>4</span>] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>mergeWith</span>(object<span class=delimiter>,</span> other<span class=delimiter>,</span> customizer);</div><div><span class=comment>// => { 'a': [1, 3], 'b': [2, 4] }</span></div></pre></div></div><div><h3 id=omit><a href=#omit class="fa fa-link"></a><code>_.omit(object, [paths])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13457>source</a> <a href=https://www.npmjs.com/package/lodash.omit>npm package</a><p>The opposite of <a href=#pick><code>_.pick</code></a>; this method creates an object composed of the own and inherited enumerable property paths of <code>object</code> that are not omitted.<br><br><strong>Note:</strong> This method is considerably slower than <a href=#pick><code>_.pick</code></a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The source object.<li><code>[paths]</code> <em>(...(string|string[]))</em>: The property paths to omit.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=string>'2'</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>omit</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'c'</span>]);</div><div><span class=comment>// => { 'b': '2' }</span></div></pre></div></div><div><h3 id=omitBy><a href=#omitBy class="fa fa-link"></a><code>_.omitBy(object, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13499>source</a> <a href=https://www.npmjs.com/package/lodash.omitby>npm package</a><p>The opposite of <a href=#pickBy><code>_.pickBy</code></a>; this method creates an object composed of the own and inherited enumerable string keyed properties of <code>object</code> that <code>predicate</code> doesn't return truthy for. The predicate is invoked with two arguments: <em>(value, key)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The source object.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per property.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=string>'2'</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>omitBy</span>(object<span class=delimiter>,</span> _<span class=delimiter>.</span>isNumber);</div><div><span class=comment>// => { 'b': '2' }</span></div></pre></div></div><div><h3 id=pick><a href=#pick class="fa fa-link"></a><code>_.pick(object, [paths])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13520>source</a> <a href=https://www.npmjs.com/package/lodash.pick>npm package</a><p>Creates an object composed of the picked <code>object</code> properties.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The source object.<li><code>[paths]</code> <em>(...(string|string[]))</em>: The property paths to pick.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=string>'2'</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pick</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'c'</span>]);</div><div><span class=comment>// => { 'a': 1, 'c': 3 }</span></div></pre></div></div><div><h3 id=pickBy><a href=#pickBy class="fa fa-link"></a><code>_.pickBy(object, [predicate=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13542>source</a> <a href=https://www.npmjs.com/package/lodash.pickby>npm package</a><p>Creates an object composed of the <code>object</code> properties <code>predicate</code> returns truthy for. The predicate is invoked with two arguments: <em>(value, key)</em>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The source object.<li><code>[predicate=_.identity]</code> <em>(Function)</em>: The function invoked per property.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=string>'2'</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pickBy</span>(object<span class=delimiter>,</span> _<span class=delimiter>.</span>isNumber);</div><div><span class=comment>// => { 'a': 1, 'c': 3 }</span></div></pre></div></div><div><h3 id=result><a href=#result class="fa fa-link"></a><code>_.result(object, path, [defaultValue])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13584>source</a> <a href=https://www.npmjs.com/package/lodash.result>npm package</a><p>This method is like <a href=#get><code>_.get</code></a> except that if the resolved value is a function it's invoked with the <code>this</code> binding of its parent object and its result is returned.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>path</code> <em>(Array|string)</em>: The path of the property to resolve.<li><code>[defaultValue]</code> <em>(*)</em>: The value returned for <code>undefined</code> resolved values.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the resolved value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c1'</span>: <span class=numeric>3</span><span class=delimiter>,</span> <span class=string>'c2'</span>: _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=numeric>4</span>) } }] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>result</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c1'</span>);</div><div><span class=comment>// => 3</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>result</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c2'</span>);</div><div><span class=comment>// => 4</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>result</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c3'</span><span class=delimiter>,</span> <span class=string>'default'</span>);</div><div><span class=comment>// => 'default'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>result</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c3'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'default'</span>));</div><div><span class=comment>// => 'default'</span></div></pre></div></div><div><h3 id=set><a href=#set class="fa fa-link"></a><code>_.set(object, path, value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13634>source</a> <a href=https://www.npmjs.com/package/lodash.set>npm package</a><p>Sets the value at <code>path</code> of <code>object</code>. If a portion of <code>path</code> doesn't exist, it's created. Arrays are created for missing index properties while objects are created for all other missing properties. Use <a href=#setWith><code>_.setWith</code></a> to customize <code>path</code> creation.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>3.7.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to modify.<li><code>path</code> <em>(Array|string)</em>: The path of the property to set.<li><code>value</code> <em>(*)</em>: The value to set.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>3</span> } }] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>set</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c'</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object<span class=delimiter>.</span>a[<span class=numeric>0</span>]<span class=delimiter>.</span>b<span class=delimiter>.</span>c);</div><div><span class=comment>// => 4</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>set</span>(object<span class=delimiter>,</span> [<span class=string>'x'</span><span class=delimiter>,</span> <span class=string>'0'</span><span class=delimiter>,</span> <span class=string>'y'</span><span class=delimiter>,</span> <span class=string>'z'</span>]<span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object<span class=delimiter>.</span><span class=support>x</span>[<span class=numeric>0</span>]<span class=delimiter>.</span><span class=support>y</span><span class=delimiter>.</span><span class=support>z</span>);</div><div><span class=comment>// => 5</span></div></pre></div></div><div><h3 id=setWith><a href=#setWith class="fa fa-link"></a><code>_.setWith(object, path, value, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13662>source</a> <a href=https://www.npmjs.com/package/lodash.setwith>npm package</a><p>This method is like <a href=#set><code>_.set</code></a> except that it accepts <code>customizer</code> which is invoked to produce the objects of <code>path</code>. If <code>customizer</code> returns <code>undefined</code> path creation is handled by the method instead. The <code>customizer</code> is invoked with three arguments: <em>(nsValue, key, nsObject)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to modify.<li><code>path</code> <em>(Array|string)</em>: The path of the property to set.<li><code>value</code> <em>(*)</em>: The value to set.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize assigned values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = {};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>setWith</span>(object<span class=delimiter>,</span> <span class=string>'[0][1]'</span><span class=delimiter>,</span> <span class=string>'a'</span><span class=delimiter>,</span> <span class=support>Object</span>);</div><div><span class=comment>// => { '0': { '1': 'a' } }</span></div></pre></div></div><div><h3 id=toPairs><a href=#toPairs class="fa fa-link"></a><code>_.toPairs(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13691>source</a> <a href=https://www.npmjs.com/package/lodash.topairs>npm package</a><p>Creates an array of own enumerable string keyed-value pairs for <code>object</code> which can be consumed by <a href=#fromPairs><code>_.fromPairs</code></a>. If <code>object</code> is a map or set, its entries are returned.<h4>Since</h4><p>4.0.0<h4>Aliases</h4><p><em>_.entries</em><h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the key-value pairs.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toPairs</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => [['a', 1], ['b', 2]] (iteration order is not guaranteed)</span></div></pre></div></div><div><h3 id=toPairsIn><a href=#toPairsIn class="fa fa-link"></a><code>_.toPairsIn(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13717>source</a> <a href=https://www.npmjs.com/package/lodash.topairsin>npm package</a><p>Creates an array of own and inherited enumerable string keyed-value pairs for <code>object</code> which can be consumed by <a href=#fromPairs><code>_.fromPairs</code></a>. If <code>object</code> is a map or set, its entries are returned.<h4>Since</h4><p>4.0.0<h4>Aliases</h4><p><em>_.entriesIn</em><h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the key-value pairs.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toPairsIn</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)</span></div></pre></div></div><div><h3 id=transform><a href=#transform class="fa fa-link"></a><code>_.transform(object, [iteratee=_.identity], [accumulator])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13749>source</a> <a href=https://www.npmjs.com/package/lodash.transform>npm package</a><p>An alternative to <a href=#reduce><code>_.reduce</code></a>; this method transforms <code>object</code> to a new <code>accumulator</code> object which is the result of running each of its own enumerable string keyed properties thru <code>iteratee</code>, with each invocation potentially mutating the <code>accumulator</code> object. If <code>accumulator</code> is not provided, a new object with the same <code>[[Prototype]]</code> will be used. The iteratee is invoked with four arguments: <em>(accumulator, value, key, object)</em>. Iteratee functions may exit iteration early by explicitly returning <code>false</code>.<h4>Since</h4><p>1.3.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to iterate over.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.<li><code>[accumulator]</code> <em>(*)</em>: The custom accumulator value.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the accumulated value.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>transform</span>([<span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>]<span class=delimiter>,</span> <span class=type>function</span>(result<span class=delimiter>,</span> n) {</div><div>  result<span class="delimiter method">.</span><span class=support>push</span>(n *= n);</div><div>  return n % <span class=numeric>2</span> == <span class=numeric>0</span>;</div><div>}<span class=delimiter>,</span> []);</div><div><span class=comment>// => [4, 9]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>transform</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span> <span class=type>function</span>(result<span class=delimiter>,</span> value<span class=delimiter>,</span> key) {</div><div>  (result[value] || (result[value] = []))<span class="delimiter method">.</span><span class=support>push</span>(key);</div><div>}<span class=delimiter>,</span> {});</div><div><span class=comment>// => { '1': ['a', 'c'], '2': ['b'] }</span></div></pre></div></div><div><h3 id=unset><a href=#unset class="fa fa-link"></a><code>_.unset(object, path)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13799>source</a> <a href=https://www.npmjs.com/package/lodash.unset>npm package</a><p>Removes the property at <code>path</code> of <code>object</code>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to modify.<li><code>path</code> <em>(Array|string)</em>: The path of the property to unset.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if the property is deleted, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>7</span> } }] };</div><div>_<span class="delimiter method">.</span><span class=name>unset</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object);</div><div><span class=comment>// => { 'a': [{ 'b': {} }] };</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>unset</span>(object<span class=delimiter>,</span> [<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'0'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span>]);</div><div><span class=comment>// => true</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object);</div><div><span class=comment>// => { 'a': [{ 'b': {} }] };</span></div></pre></div></div><div><h3 id=update><a href=#update class="fa fa-link"></a><code>_.update(object, path, updater)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13830>source</a> <a href=https://www.npmjs.com/package/lodash.update>npm package</a><p>This method is like <a href=#set><code>_.set</code></a> except that accepts <code>updater</code> to produce the value to set. Use <a href=#updateWith><code>_.updateWith</code></a> to customize <code>path</code> creation. The <code>updater</code> is invoked with one argument: <em>(value)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.6.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to modify.<li><code>path</code> <em>(Array|string)</em>: The path of the property to set.<li><code>updater</code> <em>(Function)</em>: The function to produce the updated value.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>3</span> } }] };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>update</span>(object<span class=delimiter>,</span> <span class=string>'a[0].b.c'</span><span class=delimiter>,</span> <span class=type>function</span>(n) { return n * n; });</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object<span class=delimiter>.</span>a[<span class=numeric>0</span>]<span class=delimiter>.</span>b<span class=delimiter>.</span>c);</div><div><span class=comment>// => 9</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>update</span>(object<span class=delimiter>,</span> <span class=string>'x[0].y.z'</span><span class=delimiter>,</span> <span class=type>function</span>(n) { return n ? n + <span class=numeric>1</span> : <span class=numeric>0</span>; });</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(object<span class=delimiter>.</span><span class=support>x</span>[<span class=numeric>0</span>]<span class=delimiter>.</span><span class=support>y</span><span class=delimiter>.</span><span class=support>z</span>);</div><div><span class=comment>// => 0</span></div></pre></div></div><div><h3 id=updateWith><a href=#updateWith class="fa fa-link"></a><code>_.updateWith(object, path, updater, [customizer])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13858>source</a> <a href=https://www.npmjs.com/package/lodash.updatewith>npm package</a><p>This method is like <a href=#update><code>_.update</code></a> except that it accepts <code>customizer</code> which is invoked to produce the objects of <code>path</code>. If <code>customizer</code> returns <code>undefined</code> path creation is handled by the method instead. The <code>customizer</code> is invoked with three arguments: <em>(nsValue, key, nsObject)</em>.<br><br><strong>Note:</strong> This method mutates <code>object</code>.<h4>Since</h4><p>4.6.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to modify.<li><code>path</code> <em>(Array|string)</em>: The path of the property to set.<li><code>updater</code> <em>(Function)</em>: The function to produce the updated value.<li><code>[customizer]</code> <em>(Function)</em>: The function to customize assigned values.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = {};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>updateWith</span>(object<span class=delimiter>,</span> <span class=string>'[0][1]'</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'a'</span>)<span class=delimiter>,</span> <span class=support>Object</span>);</div><div><span class=comment>// => { '0': { '1': 'a' } }</span></div></pre></div></div><div><h3 id=values><a href=#values class="fa fa-link"></a><code>_.values(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13889>source</a> <a href=https://www.npmjs.com/package/lodash.values>npm package</a><p>Creates an array of the own enumerable string keyed property values of <code>object</code>.<br><br><strong>Note:</strong> Non-object values are coerced to objects.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of property values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>values</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => [1, 2] (iteration order is not guaranteed)</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>values</span>(<span class=string>'hi'</span>);</div><div><span class=comment>// => ['h', 'i']</span></div></pre></div></div><div><h3 id=valuesIn><a href=#valuesIn class="fa fa-link"></a><code>_.valuesIn(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L13917>source</a> <a href=https://www.npmjs.com/package/lodash.valuesin>npm package</a><p>Creates an array of the own and inherited enumerable string keyed property values of <code>object</code>.<br><br><strong>Note:</strong> Non-object values are coerced to objects.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of property values.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>Foo</span>() {</div><div>  this<span class=delimiter>.</span>a = <span class=numeric>1</span>;</div><div>  this<span class=delimiter>.</span>b = <span class=numeric>2</span>;</div><div>}</div><div> </div><div>Foo<span class=delimiter>.</span><span class=support>prototype</span><span class=delimiter>.</span>c = <span class=numeric>3</span>;</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>valuesIn</span>(new <span class="name type">Foo</span>);</div><div><span class=comment>// => [1, 2, 3] (iteration order is not guaranteed)</span></div></pre></div></div></div><div><h2><code>“Seq” Methods</code></h2><div><h3 id=lodash><a href=#lodash class="fa fa-link"></a><code>_(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1669>source</a><p>Creates a <code>lodash</code> object which wraps <code>value</code> to enable implicit method chain sequences. Methods that operate on and return arrays, collections, and functions can be chained together. Methods that retrieve a single value or may return a primitive value will automatically end the chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with <code>_#value</code>.<br><br>Explicit chain sequences, which must be unwrapped with <code>_#value</code>, may be enabled using <a href=#chain><code>_.chain</code></a>.<br><br>The execution of chained methods is lazy, that is, it's deferred until <code>_#value</code> is implicitly or explicitly called.<br><br>Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion is an optimization to merge iteratee calls; this avoids the creation of intermediate arrays and can greatly reduce the number of iteratee executions. Sections of a chain sequence qualify for shortcut fusion if the section is applied to an array of at least <code>200</code> elements and any iteratees accept only one argument. The heuristic for whether a section qualifies for shortcut fusion is subject to change.<br><br>Chaining is supported in custom builds as long as the <code>_#value</code> method is directly or indirectly included in the build.<br><br>In addition to lodash methods, wrappers have <code>Array</code> and <code>String</code> methods.<br><br>The wrapper <code>Array</code> methods are:<br><code>concat</code>, <code>join</code>, <code>pop</code>, <code>push</code>, <code>shift</code>, <code>sort</code>, <code>splice</code>, and <code>unshift</code><br><br>The wrapper <code>String</code> methods are:<br><code>replace</code> and <code>split</code><br><br>The wrapper methods that support shortcut fusion are:<br><code>at</code>, <code>compact</code>, <code>drop</code>, <code>dropRight</code>, <code>dropWhile</code>, <code>filter</code>, <code>find</code>, <code>findLast</code>, <code>head</code>, <code>initial</code>, <code>last</code>, <code>map</code>, <code>reject</code>, <code>reverse</code>, <code>slice</code>, <code>tail</code>, <code>take</code>, <code>takeRight</code>, <code>takeRightWhile</code>, <code>takeWhile</code>, and <code>toArray</code><br><br>The chainable wrapper methods are:<br><code>after</code>, <code>ary</code>, <code>assign</code>, <code>assignIn</code>, <code>assignInWith</code>, <code>assignWith</code>, <code>at</code>, <code>before</code>, <code>bind</code>, <code>bindAll</code>, <code>bindKey</code>, <code>castArray</code>, <code>chain</code>, <code>chunk</code>, <code>commit</code>, <code>compact</code>, <code>concat</code>, <code>conforms</code>, <code>constant</code>, <code>countBy</code>, <code>create</code>, <code>curry</code>, <code>debounce</code>, <code>defaults</code>, <code>defaultsDeep</code>, <code>defer</code>, <code>delay</code>, <code>difference</code>, <code>differenceBy</code>, <code>differenceWith</code>, <code>drop</code>, <code>dropRight</code>, <code>dropRightWhile</code>, <code>dropWhile</code>, <code>extend</code>, <code>extendWith</code>, <code>fill</code>, <code>filter</code>, <code>flatMap</code>, <code>flatMapDeep</code>, <code>flatMapDepth</code>, <code>flatten</code>, <code>flattenDeep</code>, <code>flattenDepth</code>, <code>flip</code>, <code>flow</code>, <code>flowRight</code>, <code>fromPairs</code>, <code>functions</code>, <code>functionsIn</code>, <code>groupBy</code>, <code>initial</code>, <code>intersection</code>, <code>intersectionBy</code>, <code>intersectionWith</code>, <code>invert</code>, <code>invertBy</code>, <code>invokeMap</code>, <code>iteratee</code>, <code>keyBy</code>, <code>keys</code>, <code>keysIn</code>, <code>map</code>, <code>mapKeys</code>, <code>mapValues</code>, <code>matches</code>, <code>matchesProperty</code>, <code>memoize</code>, <code>merge</code>, <code>mergeWith</code>, <code>method</code>, <code>methodOf</code>, <code>mixin</code>, <code>negate</code>, <code>nthArg</code>, <code>omit</code>, <code>omitBy</code>, <code>once</code>, <code>orderBy</code>, <code>over</code>, <code>overArgs</code>, <code>overEvery</code>, <code>overSome</code>, <code>partial</code>, <code>partialRight</code>, <code>partition</code>, <code>pick</code>, <code>pickBy</code>, <code>plant</code>, <code>property</code>, <code>propertyOf</code>, <code>pull</code>, <code>pullAll</code>, <code>pullAllBy</code>, <code>pullAllWith</code>, <code>pullAt</code>, <code>push</code>, <code>range</code>, <code>rangeRight</code>, <code>rearg</code>, <code>reject</code>, <code>remove</code>, <code>rest</code>, <code>reverse</code>, <code>sampleSize</code>, <code>set</code>, <code>setWith</code>, <code>shuffle</code>, <code>slice</code>, <code>sort</code>, <code>sortBy</code>, <code>splice</code>, <code>spread</code>, <code>tail</code>, <code>take</code>, <code>takeRight</code>, <code>takeRightWhile</code>, <code>takeWhile</code>, <code>tap</code>, <code>throttle</code>, <code>thru</code>, <code>toArray</code>, <code>toPairs</code>, <code>toPairsIn</code>, <code>toPath</code>, <code>toPlainObject</code>, <code>transform</code>, <code>unary</code>, <code>union</code>, <code>unionBy</code>, <code>unionWith</code>, <code>uniq</code>, <code>uniqBy</code>, <code>uniqWith</code>, <code>unset</code>, <code>unshift</code>, <code>unzip</code>, <code>unzipWith</code>, <code>update</code>, <code>updateWith</code>, <code>values</code>, <code>valuesIn</code>, <code>without</code>, <code>wrap</code>, <code>xor</code>, <code>xorBy</code>, <code>xorWith</code>, <code>zip</code>, <code>zipObject</code>, <code>zipObjectDeep</code>, and <code>zipWith</code><br><br>The wrapper methods that are <strong>not</strong> chainable by default are:<br><code>add</code>, <code>attempt</code>, <code>camelCase</code>, <code>capitalize</code>, <code>ceil</code>, <code>clamp</code>, <code>clone</code>, <code>cloneDeep</code>, <code>cloneDeepWith</code>, <code>cloneWith</code>, <code>conformsTo</code>, <code>deburr</code>, <code>defaultTo</code>, <code>divide</code>, <code>each</code>, <code>eachRight</code>, <code>endsWith</code>, <code>eq</code>, <code>escape</code>, <code>escapeRegExp</code>, <code>every</code>, <code>find</code>, <code>findIndex</code>, <code>findKey</code>, <code>findLast</code>, <code>findLastIndex</code>, <code>findLastKey</code>, <code>first</code>, <code>floor</code>, <code>forEach</code>, <code>forEachRight</code>, <code>forIn</code>, <code>forInRight</code>, <code>forOwn</code>, <code>forOwnRight</code>, <code>get</code>, <code>gt</code>, <code>gte</code>, <code>has</code>, <code>hasIn</code>, <code>head</code>, <code>identity</code>, <code>includes</code>, <code>indexOf</code>, <code>inRange</code>, <code>invoke</code>, <code>isArguments</code>, <code>isArray</code>, <code>isArrayBuffer</code>, <code>isArrayLike</code>, <code>isArrayLikeObject</code>, <code>isBoolean</code>, <code>isBuffer</code>, <code>isDate</code>, <code>isElement</code>, <code>isEmpty</code>, <code>isEqual</code>, <code>isEqualWith</code>, <code>isError</code>, <code>isFinite</code>, <code>isFunction</code>, <code>isInteger</code>, <code>isLength</code>, <code>isMap</code>, <code>isMatch</code>, <code>isMatchWith</code>, <code>isNaN</code>, <code>isNative</code>, <code>isNil</code>, <code>isNull</code>, <code>isNumber</code>, <code>isObject</code>, <code>isObjectLike</code>, <code>isPlainObject</code>, <code>isRegExp</code>, <code>isSafeInteger</code>, <code>isSet</code>, <code>isString</code>, <code>isUndefined</code>, <code>isTypedArray</code>, <code>isWeakMap</code>, <code>isWeakSet</code>, <code>join</code>, <code>kebabCase</code>, <code>last</code>, <code>lastIndexOf</code>, <code>lowerCase</code>, <code>lowerFirst</code>, <code>lt</code>, <code>lte</code>, <code>max</code>, <code>maxBy</code>, <code>mean</code>, <code>meanBy</code>, <code>min</code>, <code>minBy</code>, <code>multiply</code>, <code>noConflict</code>, <code>noop</code>, <code>now</code>, <code>nth</code>, <code>pad</code>, <code>padEnd</code>, <code>padStart</code>, <code>parseInt</code>, <code>pop</code>, <code>random</code>, <code>reduce</code>, <code>reduceRight</code>, <code>repeat</code>, <code>result</code>, <code>round</code>, <code>runInContext</code>, <code>sample</code>, <code>shift</code>, <code>size</code>, <code>snakeCase</code>, <code>some</code>, <code>sortedIndex</code>, <code>sortedIndexBy</code>, <code>sortedLastIndex</code>, <code>sortedLastIndexBy</code>, <code>startCase</code>, <code>startsWith</code>, <code>stubArray</code>, <code>stubFalse</code>, <code>stubObject</code>, <code>stubString</code>, <code>stubTrue</code>, <code>subtract</code>, <code>sum</code>, <code>sumBy</code>, <code>template</code>, <code>times</code>, <code>toFinite</code>, <code>toInteger</code>, <code>toJSON</code>, <code>toLength</code>, <code>toLower</code>, <code>toNumber</code>, <code>toSafeInteger</code>, <code>toString</code>, <code>toUpper</code>, <code>trim</code>, <code>trimEnd</code>, <code>trimStart</code>, <code>truncate</code>, <code>unescape</code>, <code>uniqueId</code>, <code>upperCase</code>, <code>upperFirst</code>, <code>value</code>, and <code>words</code><h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to wrap in a <code>lodash</code> instance.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div><span class=type>var</span> wrapped = <span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>]);</div><div> </div><div><span class=comment>// Returns an unwrapped value.</span></div><div>wrapped<span class="delimiter method">.</span><span class=name>reduce</span>(_<span class=delimiter>.</span>add);</div><div><span class=comment>// => 6</span></div><div> </div><div><span class=comment>// Returns a wrapped value.</span></div><div><span class=type>var</span> squares = wrapped<span class="delimiter method">.</span><span class=name>map</span>(square);</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArray</span>(squares);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isArray</span>(squares<span class=delimiter>.</span><span class=support>value</span>());</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=chain><a href=#chain class="fa fa-link"></a><code>_.chain(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8739>source</a><p>Creates a <code>lodash</code> wrapper instance that wraps <code>value</code> with explicit method chain sequences enabled. The result of such sequences must be unwrapped with <code>_#value</code>.<h4>Since</h4><p>1.3.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to wrap.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span>  <span class=string>'age'</span>: <span class=numeric>36</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>    <span class=string>'age'</span>: <span class=numeric>40</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'pebbles'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>1</span> }</div><div>];</div><div> </div><div><span class=type>var</span> youngest = _</div><div>  <span class="delimiter method">.</span><span class=name>chain</span>(users)</div><div>  <span class="delimiter method">.</span><span class=name>sortBy</span>(<span class=string>'age'</span>)</div><div>  <span class="delimiter method">.</span><span class=name>map</span>(<span class=type>function</span>(o) {</div><div>    return o<span class=delimiter>.</span>user + <span class=string>' is '</span> + o<span class=delimiter>.</span>age;</div><div>  })</div><div>  <span class="delimiter method">.</span><span class=name>head</span>()</div><div>  <span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => 'pebbles is 1'</span></div></pre></div></div><div><h3 id=tap><a href=#tap class="fa fa-link"></a><code>_.tap(value, interceptor)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8768>source</a><p>This method invokes <code>interceptor</code> and returns <code>value</code>. The interceptor is invoked with one argument; <em>(value)</em>. The purpose of this method is to "tap into" a method chain sequence in order to modify intermediate results.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to provide to <code>interceptor</code>.<li><code>interceptor</code> <em>(Function)</em>: The function to invoke.</ol><h4>Returns</h4><p><em>(*)</em>: Returns <code>value</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>])</div><div> <span class="delimiter method">.</span><span class=name>tap</span>(<span class=type>function</span>(array) {</div><div><span class=comment></span><span class=comment>// Mutate input array.</span></div><div>   array<span class="delimiter method">.</span><span class=support>pop</span>();</div><div> })</div><div> <span class="delimiter method">.</span><span class=support>reverse</span>()</div><div> <span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => [2, 1]</span></div></pre></div></div><div><h3 id=thru><a href=#thru class="fa fa-link"></a><code>_.thru(value, interceptor)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8796>source</a><p>This method is like <a href=#tap><code>_.tap</code></a> except that it returns the result of <code>interceptor</code>. The purpose of this method is to "pass thru" values replacing intermediate results in a method chain sequence.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to provide to <code>interceptor</code>.<li><code>interceptor</code> <em>(Function)</em>: The function to invoke.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the result of <code>interceptor</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=name>_</span>(<span class=string>'  abc  '</span>)</div><div> <span class="delimiter method">.</span><span class=name>chain</span>()</div><div> <span class="delimiter method">.</span><span class=name>trim</span>()</div><div> <span class="delimiter method">.</span><span class=name>thru</span>(<span class=type>function</span>(value) {</div><div>   return [value];</div><div> })</div><div> <span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => ['abc']</span></div></pre></div></div><div><h3 id=prototype-Symbol-iterator><a href=#prototype-Symbol-iterator class="fa fa-link"></a><code>_.prototype<a href="">Symbol.iterator</a></code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8951>source</a><p>Enables the wrapper to be iterable.<h4>Since</h4><p>4.0.0<h4>Returns</h4><p><em>(Object)</em>: Returns the wrapper object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> wrapped = <span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div> </div><div>wrapped[<span class=support>Symbol</span><span class=delimiter>.</span>iterator]() === wrapped;</div><div><span class=comment>// => true</span></div><div> </div><div><span class=support>Array</span><span class="delimiter method">.</span><span class=name>from</span>(wrapped);</div><div><span class=comment>// => [1, 2]</span></div></pre></div></div><div><h3 id=prototype-at><a href=#prototype-at class="fa fa-link"></a><code>_.prototype.at([paths])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8816>source</a><p>This method is the wrapper version of <a href=#at><code>_.at</code></a>.<h4>Since</h4><p>1.0.0<h4>Arguments</h4><ol><li><code>[paths]</code> <em>(...(string|string[]))</em>: The property paths to pick.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: [{ <span class=string>'b'</span>: { <span class=string>'c'</span>: <span class=numeric>3</span> } }<span class=delimiter>,</span> <span class=numeric>4</span>] };</div><div> </div><div><span class=name>_</span>(object)<span class="delimiter method">.</span><span class=name>at</span>([<span class=string>'a[0].b.c'</span><span class=delimiter>,</span> <span class=string>'a[1]'</span>])<span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => [3, 4]</span></div></pre></div></div><div><h3 id=prototype-chain><a href=#prototype-chain class="fa fa-link"></a><code>_.prototype.chain()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8867>source</a><p>Creates a <code>lodash</code> wrapper instance with explicit method chain sequences enabled.<h4>Since</h4><p>0.1.0<h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span> }</div><div>];</div><div> </div><div><span class=comment>// A sequence without explicit chaining.</span></div><div><span class=name>_</span>(users)<span class="delimiter method">.</span><span class=name>head</span>();</div><div><span class=comment>// => { 'user': 'barney', 'age': 36 }</span></div><div> </div><div><span class=comment>// A sequence with explicit chaining.</span></div><div><span class=name>_</span>(users)</div><div>  <span class="delimiter method">.</span><span class=name>chain</span>()</div><div>  <span class="delimiter method">.</span><span class=name>head</span>()</div><div>  <span class="delimiter method">.</span><span class=name>pick</span>(<span class=string>'user'</span>)</div><div>  <span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => { 'user': 'barney' }</span></div></pre></div></div><div><h3 id=prototype-commit><a href=#prototype-commit class="fa fa-link"></a><code>_.prototype.commit()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8897>source</a><p>Executes the chain sequence and returns the wrapped result.<h4>Since</h4><p>3.2.0<h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>];</div><div><span class=type>var</span> wrapped = <span class=name>_</span>(array)<span class="delimiter method">.</span><span class=support>push</span>(<span class=numeric>3</span>);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [1, 2]</span></div><div> </div><div>wrapped = wrapped<span class="delimiter method">.</span><span class=name>commit</span>();</div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [1, 2, 3]</span></div><div> </div><div>wrapped<span class="delimiter method">.</span><span class=name>last</span>();</div><div><span class=comment>// => 3</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div><div><h3 id=prototype-next><a href=#prototype-next class="fa fa-link"></a><code>_.prototype.next()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8923>source</a><p>Gets the next value on a wrapped object following the <a href=https://mdn.io/iteration_protocols#iterator>iterator protocol</a>.<h4>Since</h4><p>4.0.0<h4>Returns</h4><p><em>(Object)</em>: Returns the next iterator value.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> wrapped = <span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]);</div><div> </div><div>wrapped<span class=delimiter>.</span><span class=support>next</span>();</div><div><span class=comment>// => { 'done': false, 'value': 1 }</span></div><div> </div><div>wrapped<span class=delimiter>.</span><span class=support>next</span>();</div><div><span class=comment>// => { 'done': false, 'value': 2 }</span></div><div> </div><div>wrapped<span class=delimiter>.</span><span class=support>next</span>();</div><div><span class=comment>// => { 'done': true, 'value': undefined }</span></div></pre></div></div><div><h3 id=prototype-plant><a href=#prototype-plant class="fa fa-link"></a><code>_.prototype.plant(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L8979>source</a><p>Creates a clone of the chain sequence planting <code>value</code> as the wrapped value.<h4>Since</h4><p>3.2.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to plant.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div><span class=type>var</span> wrapped = <span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>])<span class="delimiter method">.</span><span class=name>map</span>(square);</div><div><span class=type>var</span> other = wrapped<span class="delimiter method">.</span><span class=name>plant</span>([<span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>]);</div><div> </div><div>other<span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => [9, 16]</span></div><div> </div><div>wrapped<span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => [1, 4]</span></div></pre></div></div><div><h3 id=prototype-reverse><a href=#prototype-reverse class="fa fa-link"></a><code>_.prototype.reverse()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9019>source</a><p>This method is the wrapper version of <a href=#reverse><code>_.reverse</code></a>.<br><br><strong>Note:</strong> This method mutates the wrapped array.<h4>Since</h4><p>0.1.0<h4>Returns</h4><p><em>(Object)</em>: Returns the new <code>lodash</code> wrapper instance.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>];</div><div> </div><div><span class=name>_</span>(array)<span class="delimiter method">.</span><span class=support>reverse</span>()<span class=delimiter>.</span><span class=support>value</span>()</div><div><span class=comment>// => [3, 2, 1]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(array);</div><div><span class=comment>// => [3, 2, 1]</span></div></pre></div></div><div><h3 id=prototype-value><a href=#prototype-value class="fa fa-link"></a><code>_.prototype.value()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L9051>source</a><p>Executes the chain sequence to resolve the unwrapped value.<h4>Since</h4><p>0.1.0<h4>Aliases</h4><p><em>_.prototype.toJSON, _.prototype.valueOf</em><h4>Returns</h4><p><em>(*)</em>: Returns the resolved unwrapped value.<h4>Example</h4><div class="highlight js"><pre><div><span class=name>_</span>([<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span>])<span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => [1, 2, 3]</span></div></pre></div></div></div><div><h2><code>“String” Methods</code></h2><div><h3 id=camelCase><a href=#camelCase class="fa fa-link"></a><code>_.camelCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14100>source</a> <a href=https://www.npmjs.com/package/lodash.camelcase>npm package</a><p>Converts <code>string</code> to <a href=https://en.wikipedia.org/wiki/CamelCase>camel case</a>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the camel cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>camelCase</span>(<span class=string>'Foo Bar'</span>);</div><div><span class=comment>// => 'fooBar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>camelCase</span>(<span class=string>'--foo-bar--'</span>);</div><div><span class=comment>// => 'fooBar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>camelCase</span>(<span class=string>'__FOO_BAR__'</span>);</div><div><span class=comment>// => 'fooBar'</span></div></pre></div></div><div><h3 id=capitalize><a href=#capitalize class="fa fa-link"></a><code>_.capitalize([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14120>source</a> <a href=https://www.npmjs.com/package/lodash.capitalize>npm package</a><p>Converts the first character of <code>string</code> to upper case and the remaining to lower case.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to capitalize.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the capitalized string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>capitalize</span>(<span class=string>'FRED'</span>);</div><div><span class=comment>// => 'Fred'</span></div></pre></div></div><div><h3 id=deburr><a href=#deburr class="fa fa-link"></a><code>_.deburr([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14142>source</a> <a href=https://www.npmjs.com/package/lodash.deburr>npm package</a><p>Deburrs <code>string</code> by converting <a href=https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table>Latin-1 Supplement</a> and <a href=https://en.wikipedia.org/wiki/Latin_Extended-A>Latin Extended-A</a> letters to basic Latin letters and removing <a href=https://en.wikipedia.org/wiki/Combining_Diacritical_Marks>combining diacritical marks</a>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to deburr.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the deburred string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>deburr</span>(<span class=string>'déjà vu'</span>);</div><div><span class=comment>// => 'deja vu'</span></div></pre></div></div><div><h3 id=endsWith><a href=#endsWith class="fa fa-link"></a><code>_.endsWith([string=''], [target], [position=string.length])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14170>source</a> <a href=https://www.npmjs.com/package/lodash.endswith>npm package</a><p>Checks if <code>string</code> ends with the given target string.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to inspect.<li><code>[target]</code> <em>(string)</em>: The string to search for.<li><code>[position=string.length]</code> <em>(number)</em>: The position to search up to.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>string</code> ends with <code>target</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>endsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'c'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>endsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'b'</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>endsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=escape><a href=#escape class="fa fa-link"></a><code>_.escape([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14212>source</a> <a href=https://www.npmjs.com/package/lodash.escape>npm package</a><p>Converts the characters "&", "&lt;", ">", '"', and "'" in <code>string</code> to their corresponding HTML entities.<br><br><strong>Note:</strong> No other characters are escaped. To escape additional characters use a third-party library like <a href=https://mths.be/he><em>he</em></a>.<br><br>Though the ">" character is escaped for symmetry, characters like ">" and "/" don't need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute value. See <a href=https://mathiasbynens.be/notes/ambiguous-ampersands>Mathias Bynens's article</a> <em>(under "semi-related fun fact")</em> for more details.<br><br>When working with HTML you should always <a href=http://wonko.com/post/html-escaping>quote attribute values</a> to reduce XSS vectors.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to escape.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the escaped string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>escape</span>(<span class=string>'fred, barney, & pebbles'</span>);</div><div><span class=comment>// => 'fred, barney, &ampamp; pebbles'</span></div></pre></div></div><div><h3 id=escapeRegExp><a href=#escapeRegExp class="fa fa-link"></a><code>_.escapeRegExp([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14234>source</a> <a href=https://www.npmjs.com/package/lodash.escaperegexp>npm package</a><p>Escapes the <code>RegExp</code> special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in <code>string</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to escape.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the escaped string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>escapeRegExp</span>(<span class=string>'[lodash](https://lodash.com/)'</span>);</div><div><span class=comment>// => '\[lodash\]\(https://lodash\.com/\)'</span></div></pre></div></div><div><h3 id=kebabCase><a href=#kebabCase class="fa fa-link"></a><code>_.kebabCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14262>source</a> <a href=https://www.npmjs.com/package/lodash.kebabcase>npm package</a><p>Converts <code>string</code> to <a href=https://en.wikipedia.org/wiki/Letter_case#Special_case_styles>kebab case</a>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the kebab cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>kebabCase</span>(<span class=string>'Foo Bar'</span>);</div><div><span class=comment>// => 'foo-bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>kebabCase</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'foo-bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>kebabCase</span>(<span class=string>'__FOO_BAR__'</span>);</div><div><span class=comment>// => 'foo-bar'</span></div></pre></div></div><div><h3 id=lowerCase><a href=#lowerCase class="fa fa-link"></a><code>_.lowerCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14286>source</a> <a href=https://www.npmjs.com/package/lodash.lowercase>npm package</a><p>Converts <code>string</code>, as space separated words, to lower case.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the lower cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>lowerCase</span>(<span class=string>'--Foo-Bar--'</span>);</div><div><span class=comment>// => 'foo bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lowerCase</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'foo bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lowerCase</span>(<span class=string>'__FOO_BAR__'</span>);</div><div><span class=comment>// => 'foo bar'</span></div></pre></div></div><div><h3 id=lowerFirst><a href=#lowerFirst class="fa fa-link"></a><code>_.lowerFirst([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14307>source</a> <a href=https://www.npmjs.com/package/lodash.lowerfirst>npm package</a><p>Converts the first character of <code>string</code> to lower case.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the converted string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>lowerFirst</span>(<span class=string>'Fred'</span>);</div><div><span class=comment>// => 'fred'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>lowerFirst</span>(<span class=string>'FRED'</span>);</div><div><span class=comment>// => 'fRED'</span></div></pre></div></div><div><h3 id=pad><a href=#pad class="fa fa-link"></a><code>_.pad([string=''], [length=0], [chars=' '])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14332>source</a> <a href=https://www.npmjs.com/package/lodash.pad>npm package</a><p>Pads <code>string</code> on the left and right sides if it's shorter than <code>length</code>. Padding characters are truncated if they can't be evenly divided by <code>length</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to pad.<li><code>[length=0]</code> <em>(number)</em>: The padding length.<li><code>[chars=' ']</code> <em>(string)</em>: The string used as padding.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the padded string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>pad</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>8</span>);</div><div><span class=comment>// => '  abc   '</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pad</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>8</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => '_-abc_-_'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>pad</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => 'abc'</span></div></pre></div></div><div><h3 id=padEnd><a href=#padEnd class="fa fa-link"></a><code>_.padEnd([string=''], [length=0], [chars=' '])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14371>source</a> <a href=https://www.npmjs.com/package/lodash.padend>npm package</a><p>Pads <code>string</code> on the right side if it's shorter than <code>length</code>. Padding characters are truncated if they exceed <code>length</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to pad.<li><code>[length=0]</code> <em>(number)</em>: The padding length.<li><code>[chars=' ']</code> <em>(string)</em>: The string used as padding.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the padded string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>padEnd</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>6</span>);</div><div><span class=comment>// => 'abc   '</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>padEnd</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>6</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => 'abc_-_'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>padEnd</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => 'abc'</span></div></pre></div></div><div><h3 id=padStart><a href=#padStart class="fa fa-link"></a><code>_.padStart([string=''], [length=0], [chars=' '])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14404>source</a> <a href=https://www.npmjs.com/package/lodash.padstart>npm package</a><p>Pads <code>string</code> on the left side if it's shorter than <code>length</code>. Padding characters are truncated if they exceed <code>length</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to pad.<li><code>[length=0]</code> <em>(number)</em>: The padding length.<li><code>[chars=' ']</code> <em>(string)</em>: The string used as padding.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the padded string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>padStart</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>6</span>);</div><div><span class=comment>// => '   abc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>padStart</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>6</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => '_-_abc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>padStart</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => 'abc'</span></div></pre></div></div><div><h3 id=parseInt><a href=#parseInt class="fa fa-link"></a><code>_.parseInt(string, [radix=10])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14438>source</a> <a href=https://www.npmjs.com/package/lodash.parseint>npm package</a><p>Converts <code>string</code> to an integer of the specified radix. If <code>radix</code> is <code>undefined</code> or <code>0</code>, a <code>radix</code> of <code>10</code> is used unless <code>value</code> is a hexadecimal, in which case a <code>radix</code> of <code>16</code> is used.<br><br><strong>Note:</strong> This method aligns with the <a href=https://es5.github.io/#x15.1.2.2>ES5 implementation</a> of <code>parseInt</code>.<h4>Since</h4><p>1.1.0<h4>Arguments</h4><ol><li><code>string</code> <em>(string)</em>: The string to convert.<li><code>[radix=10]</code> <em>(number)</em>: The radix to interpret <code>value</code> by.</ol><h4>Returns</h4><p><em>(number)</em>: Returns the converted integer.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>parseInt</span>(<span class=string>'08'</span>);</div><div><span class=comment>// => 8</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'6'</span><span class=delimiter>,</span> <span class=string>'08'</span><span class=delimiter>,</span> <span class=string>'10'</span>]<span class=delimiter>,</span> _<span class=delimiter>.</span>parseInt);</div><div><span class=comment>// => [6, 8, 10]</span></div></pre></div></div><div><h3 id=repeat><a href=#repeat class="fa fa-link"></a><code>_.repeat([string=''], [n=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14469>source</a> <a href=https://www.npmjs.com/package/lodash.repeat>npm package</a><p>Repeats the given string <code>n</code> times.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to repeat.<li><code>[n=1]</code> <em>(number)</em>: The number of times to repeat the string.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the repeated string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>repeat</span>(<span class=string>'*'</span><span class=delimiter>,</span> <span class=numeric>3</span>);</div><div><span class=comment>// => '***'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>repeat</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 'abcabc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>repeat</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => ''</span></div></pre></div></div><div><h3 id=replace><a href=#replace class="fa fa-link"></a><code>_.replace([string=''], pattern, replacement)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14497>source</a> <a href=https://www.npmjs.com/package/lodash.replace>npm package</a><p>Replaces matches for <code>pattern</code> in <code>string</code> with <code>replacement</code>.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/String/replace><code>String#replace</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to modify.<li><code>pattern</code> <em>(RegExp|string)</em>: The pattern to replace.<li><code>replacement</code> <em>(Function|string)</em>: The match replacement.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the modified string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>replace</span>(<span class=string>'Hi Fred'</span><span class=delimiter>,</span> <span class=string>'Fred'</span><span class=delimiter>,</span> <span class=string>'Barney'</span>);</div><div><span class=comment>// => 'Hi Barney'</span></div></pre></div></div><div><h3 id=snakeCase><a href=#snakeCase class="fa fa-link"></a><code>_.snakeCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14525>source</a> <a href=https://www.npmjs.com/package/lodash.snakecase>npm package</a><p>Converts <code>string</code> to <a href=https://en.wikipedia.org/wiki/Snake_case>snake case</a>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the snake cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>snakeCase</span>(<span class=string>'Foo Bar'</span>);</div><div><span class=comment>// => 'foo_bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>snakeCase</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'foo_bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>snakeCase</span>(<span class=string>'--FOO-BAR--'</span>);</div><div><span class=comment>// => 'foo_bar'</span></div></pre></div></div><div><h3 id=split><a href=#split class="fa fa-link"></a><code>_.split([string=''], separator, [limit])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14548>source</a> <a href=https://www.npmjs.com/package/lodash.split>npm package</a><p>Splits <code>string</code> by <code>separator</code>.<br><br><strong>Note:</strong> This method is based on <a href=https://mdn.io/String/split><code>String#split</code></a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to split.<li><code>separator</code> <em>(RegExp|string)</em>: The separator pattern to split by.<li><code>[limit]</code> <em>(number)</em>: The length to truncate results to.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the string segments.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=support>split</span>(<span class=string>'a-b-c'</span><span class=delimiter>,</span> <span class=string>'-'</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => ['a', 'b']</span></div></pre></div></div><div><h3 id=startCase><a href=#startCase class="fa fa-link"></a><code>_.startCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14590>source</a> <a href=https://www.npmjs.com/package/lodash.startcase>npm package</a><p>Converts <code>string</code> to <a href=https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage>start case</a>.<h4>Since</h4><p>3.1.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the start cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>startCase</span>(<span class=string>'--foo-bar--'</span>);</div><div><span class=comment>// => 'Foo Bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>startCase</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'Foo Bar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>startCase</span>(<span class=string>'__FOO_BAR__'</span>);</div><div><span class=comment>// => 'FOO BAR'</span></div></pre></div></div><div><h3 id=startsWith><a href=#startsWith class="fa fa-link"></a><code>_.startsWith([string=''], [target], [position=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14617>source</a> <a href=https://www.npmjs.com/package/lodash.startswith>npm package</a><p>Checks if <code>string</code> starts with the given target string.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to inspect.<li><code>[target]</code> <em>(string)</em>: The string to search for.<li><code>[position=0]</code> <em>(number)</em>: The position to search from.</ol><h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code> if <code>string</code> starts with <code>target</code>, else <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>startsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'a'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>startsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'b'</span>);</div><div><span class=comment>// => false</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>startsWith</span>(<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=numeric>1</span>);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=template><a href=#template class="fa fa-link"></a><code>_.template([string=''], [options={}])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14728>source</a> <a href=https://www.npmjs.com/package/lodash.template>npm package</a><p>Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data properties may be accessed as free variables in the template. If a setting object is given, it takes precedence over <a href=#templateSettings><code>_.templateSettings</code></a> values.<br><br><strong>Note:</strong> In the development build <a href=#template><code>_.template</code></a> utilizes <a href=http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl>sourceURLs</a> for easier debugging.<br><br>For more information on precompiling templates see <a href=https://lodash.com/custom-builds>lodash's custom builds documentation</a>.<br><br>For more information on Chrome extension sandboxes see <a href=https://developer.chrome.com/extensions/sandboxingEval>Chrome's extensions documentation</a>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The template string.<li><code>[options={}]</code> <em>(Object)</em>: The options object.<li><code>[options.escape=_.templateSettings.escape]</code> <em>(RegExp)</em>: The HTML "escape" delimiter.<li><code>[options.evaluate=_.templateSettings.evaluate]</code> <em>(RegExp)</em>: The "evaluate" delimiter.<li><code>[options.imports=_.templateSettings.imports]</code> <em>(Object)</em>: An object to import into the template as free variables.<li><code>[options.interpolate=_.templateSettings.interpolate]</code> <em>(RegExp)</em>: The "interpolate" delimiter.<li><code>[options.sourceURL='lodash.templateSources[n]']</code> <em>(string)</em>: The sourceURL of the compiled template.<li><code>[options.variable='obj']</code> <em>(string)</em>: The data object variable name.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the compiled template function.<h4>Example</h4><div class="highlight js"><pre><div><span class=comment>// Use the "interpolate" delimiter to create a compiled template.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'hello &lt;%= user %>!'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'user'</span>: <span class=string>'fred'</span> });</div><div><span class=comment>// => 'hello fred!'</span></div><div> </div><div><span class=comment>// Use the HTML "escape" delimiter to escape data property values.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'&lt;b>&lt;%- value %>&lt;/b>'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'value'</span>: <span class=string>'&lt;script>'</span> });</div><div><span class=comment>// => '&lt;b>&amplt;script&ampgt;&lt;/b>'</span></div><div> </div><div><span class=comment>// Use the "evaluate" delimiter to execute JavaScript and generate HTML.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'&lt;% _.forEach(users, function(user) { %>&lt;li>&lt;%- user %>&lt;/li>&lt;% }); %>'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'users'</span>: [<span class=string>'fred'</span><span class=delimiter>,</span> <span class=string>'barney'</span>] });</div><div><span class=comment>// => '&lt;li>fred&lt;/li>&lt;li>barney&lt;/li>'</span></div><div> </div><div><span class=comment>// Use the internal `print` function in "evaluate" delimiters.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'&lt;% print("hello " + user); %>!'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'user'</span>: <span class=string>'barney'</span> });</div><div><span class=comment>// => 'hello barney!'</span></div><div> </div><div><span class=comment>// Use the ES template literal delimiter as an "interpolate" delimiter.</span></div><div><span class=comment>// Disable support by replacing the "interpolate" delimiter.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'hello ${ user }!'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'user'</span>: <span class=string>'pebbles'</span> });</div><div><span class=comment>// => 'hello pebbles!'</span></div><div> </div><div><span class=comment>// Use backslashes to treat delimiters as plain text.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'&lt;%= "\\&lt;%- value %\\>" %>'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'value'</span>: <span class=string>'ignored'</span> });</div><div><span class=comment>// => '&lt;%- value %>'</span></div><div> </div><div><span class=comment>// Use the `imports` option to import `jQuery` as `jq`.</span></div><div><span class=type>var</span> text = <span class=string>'&lt;% jq.each(users, function(user) { %>&lt;li>&lt;%- user %>&lt;/li>&lt;% }); %>'</span>;</div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(text<span class=delimiter>,</span> { <span class=string>'imports'</span>: { <span class=string>'jq'</span>: jQuery } });</div><div><span class=name>compiled</span>({ <span class=string>'users'</span>: [<span class=string>'fred'</span><span class=delimiter>,</span> <span class=string>'barney'</span>] });</div><div><span class=comment>// => '&lt;li>fred&lt;/li>&lt;li>barney&lt;/li>'</span></div><div> </div><div><span class=comment>// Use the `sourceURL` option to specify a custom sourceURL for the template.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'hello &lt;%= user %>!'</span><span class=delimiter>,</span> { <span class=string>'sourceURL'</span>: <span class=string>'/basic/greeting.jst'</span> });</div><div><span class=name>compiled</span>(data);</div><div><span class=comment>// => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.</span></div><div> </div><div><span class=comment>// Use the `variable` option to ensure a with-statement isn't used in the compiled template.</span></div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'hi &lt;%= data.user %>!'</span><span class=delimiter>,</span> { <span class=string>'variable'</span>: <span class=string>'data'</span> });</div><div>compiled<span class=delimiter>.</span><span class=support>source</span>;</div><div><span class=comment>// => function(data) {</span></div><div><span class=comment>//   var __t, __p = '';</span></div><div><span class=comment>//   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';</span></div><div><span class=comment>//   return __p;</span></div><div><span class=comment>// }</span></div><div> </div><div><span class=comment>// Use custom template delimiters.</span></div><div>_<span class=delimiter>.</span>templateSettings<span class=delimiter>.</span>interpolate = /{{([\s\S]+?)}}/g;</div><div><span class=type>var</span> compiled = _<span class="delimiter method">.</span><span class=name>template</span>(<span class=string>'hello {{ user }}!'</span>);</div><div><span class=name>compiled</span>({ <span class=string>'user'</span>: <span class=string>'mustache'</span> });</div><div><span class=comment>// => 'hello mustache!'</span></div><div> </div><div><span class=comment>// Use the `source` property to inline compiled templates for meaningful</span></div><div><span class=comment>// line numbers in error messages and stack traces.</span></div><div>fs<span class="delimiter method">.</span><span class=name>writeFileSync</span>(path<span class="delimiter method">.</span><span class=support>join</span>(<span class=support>process</span><span class="delimiter method">.</span><span class=name>cwd</span>()<span class=delimiter>,</span> <span class=string>'jst.js'</span>)<span class=delimiter>,</span> <span class=string>'\</span></div><div><span class=string>  var JST = {\</span></div><div><span class=string>    "main": '</span> + _<span class="delimiter method">.</span><span class=name>template</span>(mainText)<span class=delimiter>.</span><span class=support>source</span> + <span class=string>'\</span></div><div><span class=string>  };\</span></div><div><span class=string>'</span>);</div></pre></div></div><div><h3 id=toLower><a href=#toLower class="fa fa-link"></a><code>_.toLower([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14857>source</a> <a href=https://www.npmjs.com/package/lodash.tolower>npm package</a><p>Converts <code>string</code>, as a whole, to lower case just like <a href=https://mdn.io/toLowerCase>String#toLowerCase</a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the lower cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toLower</span>(<span class=string>'--Foo-Bar--'</span>);</div><div><span class=comment>// => '--foo-bar--'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toLower</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'foobar'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toLower</span>(<span class=string>'__FOO_BAR__'</span>);</div><div><span class=comment>// => '__foo_bar__'</span></div></pre></div></div><div><h3 id=toUpper><a href=#toUpper class="fa fa-link"></a><code>_.toUpper([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14882>source</a> <a href=https://www.npmjs.com/package/lodash.toupper>npm package</a><p>Converts <code>string</code>, as a whole, to upper case just like <a href=https://mdn.io/toUpperCase>String#toUpperCase</a>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the upper cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toUpper</span>(<span class=string>'--foo-bar--'</span>);</div><div><span class=comment>// => '--FOO-BAR--'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toUpper</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'FOOBAR'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toUpper</span>(<span class=string>'__foo_bar__'</span>);</div><div><span class=comment>// => '__FOO_BAR__'</span></div></pre></div></div><div><h3 id=trim><a href=#trim class="fa fa-link"></a><code>_.trim([string=''], [chars=whitespace])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14908>source</a> <a href=https://www.npmjs.com/package/lodash.trim>npm package</a><p>Removes leading and trailing whitespace or specified characters from <code>string</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to trim.<li><code>[chars=whitespace]</code> <em>(string)</em>: The characters to trim.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the trimmed string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>trim</span>(<span class=string>'  abc  '</span>);</div><div><span class=comment>// => 'abc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>trim</span>(<span class=string>'-_-abc-_-'</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => 'abc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'  foo  '</span><span class=delimiter>,</span> <span class=string>'  bar  '</span>]<span class=delimiter>,</span> _<span class=delimiter>.</span>trim);</div><div><span class=comment>// => ['foo', 'bar']</span></div></pre></div></div><div><h3 id=trimEnd><a href=#trimEnd class="fa fa-link"></a><code>_.trimEnd([string=''], [chars=whitespace])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14943>source</a> <a href=https://www.npmjs.com/package/lodash.trimend>npm package</a><p>Removes trailing whitespace or specified characters from <code>string</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to trim.<li><code>[chars=whitespace]</code> <em>(string)</em>: The characters to trim.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the trimmed string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>trimEnd</span>(<span class=string>'  abc  '</span>);</div><div><span class=comment>// => '  abc'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>trimEnd</span>(<span class=string>'-_-abc-_-'</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => '-_-abc'</span></div></pre></div></div><div><h3 id=trimStart><a href=#trimStart class="fa fa-link"></a><code>_.trimStart([string=''], [chars=whitespace])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L14976>source</a> <a href=https://www.npmjs.com/package/lodash.trimstart>npm package</a><p>Removes leading whitespace or specified characters from <code>string</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to trim.<li><code>[chars=whitespace]</code> <em>(string)</em>: The characters to trim.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the trimmed string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>trimStart</span>(<span class=string>'  abc  '</span>);</div><div><span class=comment>// => 'abc  '</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>trimStart</span>(<span class=string>'-_-abc-_-'</span><span class=delimiter>,</span> <span class=string>'_-'</span>);</div><div><span class=comment>// => 'abc-_-'</span></div></pre></div></div><div><h3 id=truncate><a href=#truncate class="fa fa-link"></a><code>_.truncate([string=''], [options={}])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15027>source</a> <a href=https://www.npmjs.com/package/lodash.truncate>npm package</a><p>Truncates <code>string</code> if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "...".<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to truncate.<li><code>[options={}]</code> <em>(Object)</em>: The options object.<li><code>[options.length=30]</code> <em>(number)</em>: The maximum string length.<li><code>[options.omission='...']</code> <em>(string)</em>: The string to indicate text is omitted.<li><code>[options.separator]</code> <em>(RegExp|string)</em>: The separator pattern to truncate to.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the truncated string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>truncate</span>(<span class=string>'hi-diddly-ho there, neighborino'</span>);</div><div><span class=comment>// => 'hi-diddly-ho there, neighbo...'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>truncate</span>(<span class=string>'hi-diddly-ho there, neighborino'</span><span class=delimiter>,</span> {</div><div>  <span class=string>'length'</span>: <span class=numeric>24</span><span class=delimiter>,</span></div><div>  <span class=string>'separator'</span>: <span class=string>' '</span></div><div>});</div><div><span class=comment>// => 'hi-diddly-ho there,...'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>truncate</span>(<span class=string>'hi-diddly-ho there, neighborino'</span><span class=delimiter>,</span> {</div><div>  <span class=string>'length'</span>: <span class=numeric>24</span><span class=delimiter>,</span></div><div>  <span class=string>'separator'</span>:<span class=string> /,? +/</span></div><div>});</div><div><span class=comment>// => 'hi-diddly-ho there...'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>truncate</span>(<span class=string>'hi-diddly-ho there, neighborino'</span><span class=delimiter>,</span> {</div><div>  <span class=string>'omission'</span>: <span class=string>' [...]'</span></div><div>});</div><div><span class=comment>// => 'hi-diddly-ho there, neig [...]'</span></div></pre></div></div><div><h3 id=unescape><a href=#unescape class="fa fa-link"></a><code>_.unescape([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15102>source</a> <a href=https://www.npmjs.com/package/lodash.unescape>npm package</a><p>The inverse of <a href=#escape><code>_.escape</code></a>; this method converts the HTML entities <code>&ampamp;</code>, <code>&amplt;</code>, <code>&ampgt;</code>, <code>&ampquot;</code>, and <code>&amp#39;</code> in <code>string</code> to their corresponding characters.<br><br><strong>Note:</strong> No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library like <a href=https://mths.be/he><em>he</em></a>.<h4>Since</h4><p>0.6.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to unescape.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the unescaped string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>unescape</span>(<span class=string>'fred, barney, &ampamp; pebbles'</span>);</div><div><span class=comment>// => 'fred, barney, & pebbles'</span></div></pre></div></div><div><h3 id=upperCase><a href=#upperCase class="fa fa-link"></a><code>_.upperCase([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15129>source</a> <a href=https://www.npmjs.com/package/lodash.uppercase>npm package</a><p>Converts <code>string</code>, as space separated words, to upper case.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the upper cased string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>upperCase</span>(<span class=string>'--foo-bar'</span>);</div><div><span class=comment>// => 'FOO BAR'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>upperCase</span>(<span class=string>'fooBar'</span>);</div><div><span class=comment>// => 'FOO BAR'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>upperCase</span>(<span class=string>'__foo_bar__'</span>);</div><div><span class=comment>// => 'FOO BAR'</span></div></pre></div></div><div><h3 id=upperFirst><a href=#upperFirst class="fa fa-link"></a><code>_.upperFirst([string=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15150>source</a> <a href=https://www.npmjs.com/package/lodash.upperfirst>npm package</a><p>Converts the first character of <code>string</code> to upper case.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to convert.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the converted string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>upperFirst</span>(<span class=string>'fred'</span>);</div><div><span class=comment>// => 'Fred'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>upperFirst</span>(<span class=string>'FRED'</span>);</div><div><span class=comment>// => 'FRED'</span></div></pre></div></div><div><h3 id=words><a href=#words class="fa fa-link"></a><code>_.words([string=''], [pattern])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15171>source</a> <a href=https://www.npmjs.com/package/lodash.words>npm package</a><p>Splits <code>string</code> into an array of its words.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[string='']</code> <em>(string)</em>: The string to inspect.<li><code>[pattern]</code> <em>(RegExp|string)</em>: The pattern to match words.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the words of <code>string</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>words</span>(<span class=string>'fred, barney, & pebbles'</span>);</div><div><span class=comment>// => ['fred', 'barney', 'pebbles']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>words</span>(<span class=string>'fred, barney, & pebbles'</span><span class=delimiter>,</span><span class=string> /[^, ]+/g</span>);</div><div><span class=comment>// => ['fred', 'barney', '&', 'pebbles']</span></div></pre></div></div></div><div><h2><code>“Util” Methods</code></h2><div><h3 id=attempt><a href=#attempt class="fa fa-link"></a><code>_.attempt(func, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15205>source</a> <a href=https://www.npmjs.com/package/lodash.attempt>npm package</a><p>Attempts to invoke <code>func</code>, returning either the result or the caught error object. Any additional arguments are provided to <code>func</code> when it's invoked.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>func</code> <em>(Function)</em>: The function to attempt.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke <code>func</code> with.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the <code>func</code> result or error object.<h4>Example</h4><div class="highlight js"><pre><div><span class=comment>// Avoid throwing errors for invalid selectors.</span></div><div><span class=type>var</span> elements = _<span class="delimiter method">.</span><span class=name>attempt</span>(<span class=type>function</span>(selector) {</div><div>  return <span class=support>document</span><span class="delimiter method">.</span><span class=name>querySelectorAll</span>(selector);</div><div>}<span class=delimiter>,</span> <span class=string>'>_>'</span>);</div><div> </div><div>if (_<span class="delimiter method">.</span><span class=name>isError</span>(elements)) {</div><div>  elements = [];</div><div>}</div></pre></div></div><div><h3 id=bindAll><a href=#bindAll class="fa fa-link"></a><code>_.bindAll(object, methodNames)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15239>source</a> <a href=https://www.npmjs.com/package/lodash.bindall>npm package</a><p>Binds methods of an object to the object itself, overwriting the existing method.<br><br><strong>Note:</strong> This method doesn't set the "length" property of bound functions.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to bind and assign the bound methods to.<li><code>methodNames</code> <em>(...(string|string[]))</em>: The object method names to bind.</ol><h4>Returns</h4><p><em>(Object)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> view = {</div><div>  <span class=string>'label'</span>: <span class=string>'docs'</span><span class=delimiter>,</span></div><div>  <span class=string>'click'</span>: <span class=type>function</span>() {</div><div>    <span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(<span class=string>'clicked '</span> + this<span class=delimiter>.</span><span class=support>label</span>);</div><div>  }</div><div>};</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>bindAll</span>(view<span class=delimiter>,</span> [<span class=string>'click'</span>]);</div><div><span class=name>jQuery</span>(element)<span class="delimiter method">.</span><span class=name>on</span>(<span class=string>'click'</span><span class=delimiter>,</span> view<span class=delimiter>.</span>click);</div><div><span class=comment>// => Logs 'clicked docs' when clicked.</span></div></pre></div></div><div><h3 id=cond><a href=#cond class="fa fa-link"></a><code>_.cond(pairs)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15276>source</a> <a href=https://www.npmjs.com/package/lodash.cond>npm package</a><p>Creates a function that iterates over <code>pairs</code> and invokes the corresponding function of the first predicate to return truthy. The predicate-function pairs are invoked with the <code>this</code> binding and arguments of the created function.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>pairs</code> <em>(Array)</em>: The predicate-function pairs.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new composite function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>cond</span>([</div><div>  [_<span class="delimiter method">.</span><span class=name>matches</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> })<span class=delimiter>,</span>           _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'matches A'</span>)]<span class=delimiter>,</span></div><div>  [_<span class="delimiter method">.</span><span class=name>conforms</span>({ <span class=string>'b'</span>: _<span class=delimiter>.</span>isNumber })<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'matches B'</span>)]<span class=delimiter>,</span></div><div>  [_<span class=delimiter>.</span>stubTrue<span class=delimiter>,</span>                      _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'no match'</span>)]</div><div>]);</div><div> </div><div><span class=name>func</span>({ <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> });</div><div><span class=comment>// => 'matches A'</span></div><div> </div><div><span class=name>func</span>({ <span class=string>'a'</span>: <span class=numeric>0</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>1</span> });</div><div><span class=comment>// => 'matches B'</span></div><div> </div><div><span class=name>func</span>({ <span class=string>'a'</span>: <span class=string>'1'</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=string>'2'</span> });</div><div><span class=comment>// => 'no match'</span></div></pre></div></div><div><h3 id=conforms><a href=#conforms class="fa fa-link"></a><code>_.conforms(source)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15322>source</a> <a href=https://www.npmjs.com/package/lodash.conforms>npm package</a><p>Creates a function that invokes the predicate properties of <code>source</code> with the corresponding property values of a given object, returning <code>true</code> if all predicates return truthy, else <code>false</code>.<br><br><strong>Note:</strong> The created function is equivalent to <a href=#conformsTo><code>_.conformsTo</code></a> with <code>source</code> partially applied.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>source</code> <em>(Object)</em>: The object of property predicates to conform to.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new spec function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [</div><div>  { <span class=string>'a'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>1</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span> }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(objects<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>conforms</span>({ <span class=string>'b'</span>: <span class=type>function</span>(n) { return n > <span class=numeric>1</span>; } }));</div><div><span class=comment>// => [{ 'a': 1, 'b': 2 }]</span></div></pre></div></div><div><h3 id=constant><a href=#constant class="fa fa-link"></a><code>_.constant(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15345>source</a> <a href=https://www.npmjs.com/package/lodash.constant>npm package</a><p>Creates a function that returns <code>value</code>.<h4>Since</h4><p>2.4.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to return from the new function.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new constant function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = _<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>constant</span>({ <span class=string>'a'</span>: <span class=numeric>1</span> }));</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(objects);</div><div><span class=comment>// => [{ 'a': 1 }, { 'a': 1 }]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(objects[<span class=numeric>0</span>] === objects[<span class=numeric>1</span>]);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=defaultTo><a href=#defaultTo class="fa fa-link"></a><code>_.defaultTo(value, defaultValue)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15371>source</a> <a href=https://www.npmjs.com/package/lodash.defaultto>npm package</a><p>Checks <code>value</code> to determine whether a default value should be returned in its place. The <code>defaultValue</code> is returned if <code>value</code> is <code>NaN</code>, <code>null</code>, or <code>undefined</code>.<h4>Since</h4><p>4.14.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to check.<li><code>defaultValue</code> <em>(*)</em>: The default value.</ol><h4>Returns</h4><p><em>(*)</em>: Returns the resolved value.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>defaultTo</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>10</span>);</div><div><span class=comment>// => 1</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>defaultTo</span>(undefined<span class=delimiter>,</span> <span class=numeric>10</span>);</div><div><span class=comment>// => 10</span></div></pre></div></div><div><h3 id=flow><a href=#flow class="fa fa-link"></a><code>_.flow([funcs])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15397>source</a> <a href=https://www.npmjs.com/package/lodash.flow>npm package</a><p>Creates a function that returns the result of invoking the given functions with the <code>this</code> binding of the created function, where each successive invocation is supplied the return value of the previous.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[funcs]</code> <em>(...(Function|Function[]))</em>: The functions to invoke.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new composite function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div><span class=type>var</span> addSquare = _<span class="delimiter method">.</span><span class=name>flow</span>([_<span class=delimiter>.</span>add<span class=delimiter>,</span> square]);</div><div><span class=name>addSquare</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 9</span></div></pre></div></div><div><h3 id=flowRight><a href=#flowRight class="fa fa-link"></a><code>_.flowRight([funcs])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15420>source</a> <a href=https://www.npmjs.com/package/lodash.flowright>npm package</a><p>This method is like <a href=#flow><code>_.flow</code></a> except that it creates a function that invokes the given functions from right to left.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>[funcs]</code> <em>(...(Function|Function[]))</em>: The functions to invoke.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new composite function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>square</span>(n) {</div><div>  return n * n;</div><div>}</div><div> </div><div><span class=type>var</span> addSquare = _<span class="delimiter method">.</span><span class=name>flowRight</span>([square<span class=delimiter>,</span> _<span class=delimiter>.</span>add]);</div><div><span class=name>addSquare</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>);</div><div><span class=comment>// => 9</span></div></pre></div></div><div><h3 id=identity><a href=#identity class="fa fa-link"></a><code>_.identity(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15438>source</a> <a href=https://www.npmjs.com/package/lodash.identity>npm package</a><p>This method returns the first argument it receives.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: Any value.</ol><h4>Returns</h4><p><em>(*)</em>: Returns <code>value</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> object = { <span class=string>'a'</span>: <span class=numeric>1</span> };</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(_<span class="delimiter method">.</span><span class=name>identity</span>(object) === object);</div><div><span class=comment>// => true</span></div></pre></div></div><div><h3 id=iteratee><a href=#iteratee class="fa fa-link"></a><code>_.iteratee([func=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15484>source</a> <a href=https://www.npmjs.com/package/lodash.iteratee>npm package</a><p>Creates a function that invokes <code>func</code> with the arguments of the created function. If <code>func</code> is a property name, the created function returns the property value for a given element. If <code>func</code> is an array or object, the created function returns <code>true</code> for elements that contain the equivalent source properties, otherwise it returns <code>false</code>.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[func=_.identity]</code> <em>(*)</em>: The value to convert to a callback.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the callback.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> users = [</div><div>  { <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'age'</span>: <span class=numeric>36</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }<span class=delimiter>,</span></div><div>  { <span class=string>'user'</span>: <span class=string>'fred'</span><span class=delimiter>,</span>   <span class=string>'age'</span>: <span class=numeric>40</span><span class=delimiter>,</span> <span class=string>'active'</span>: false }</div><div>];</div><div> </div><div><span class=comment>// The `_.matches` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>iteratee</span>({ <span class=string>'user'</span>: <span class=string>'barney'</span><span class=delimiter>,</span> <span class=string>'active'</span>: true }));</div><div><span class=comment>// => [{ 'user': 'barney', 'age': 36, 'active': true }]</span></div><div> </div><div><span class=comment>// The `_.matchesProperty` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(users<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>iteratee</span>([<span class=string>'user'</span><span class=delimiter>,</span> <span class=string>'fred'</span>]));</div><div><span class=comment>// => [{ 'user': 'fred', 'age': 40 }]</span></div><div> </div><div><span class=comment>// The `_.property` iteratee shorthand.</span></div><div>_<span class="delimiter method">.</span><span class=name>map</span>(users<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>iteratee</span>(<span class=string>'user'</span>));</div><div><span class=comment>// => ['barney', 'fred']</span></div><div> </div><div><span class=comment>// Create custom iteratee shorthands.</span></div><div>_<span class=delimiter>.</span>iteratee = _<span class="delimiter method">.</span><span class=name>wrap</span>(_<span class=delimiter>.</span>iteratee<span class=delimiter>,</span> <span class=type>function</span>(iteratee<span class=delimiter>,</span> func) {</div><div>  return !_<span class="delimiter method">.</span><span class=name>isRegExp</span>(func) ? <span class=name>iteratee</span>(func) : <span class=type>function</span>(string) {</div><div>    return func<span class="delimiter method">.</span><span class=support>test</span>(string);</div><div>  };</div><div>});</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>filter</span>([<span class=string>'abc'</span><span class=delimiter>,</span> <span class=string>'def'</span>]<span class=delimiter>,</span><span class=string> /ef/</span>);</div><div><span class=comment>// => ['def']</span></div></pre></div></div><div><h3 id=matches><a href=#matches class="fa fa-link"></a><code>_.matches(source)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15516>source</a> <a href=https://www.npmjs.com/package/lodash.matches>npm package</a><p>Creates a function that performs a partial deep comparison between a given object and <code>source</code>, returning <code>true</code> if the given object has equivalent property values, else <code>false</code>.<br><br><strong>Note:</strong> The created function is equivalent to <a href=#isMatch><code>_.isMatch</code></a> with <code>source</code> partially applied.<br><br>Partial comparisons will match empty array and empty object <code>source</code> values against any array or object value, respectively. See <a href=#isEqual><code>_.isEqual</code></a> for a list of supported value comparisons.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>source</code> <em>(Object)</em>: The object of property values to match.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new spec function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [</div><div>  { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'a'</span>: <span class=numeric>4</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>5</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>6</span> }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>filter</span>(objects<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>matches</span>({ <span class=string>'a'</span>: <span class=numeric>4</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>6</span> }));</div><div><span class=comment>// => [{ 'a': 4, 'b': 5, 'c': 6 }]</span></div></pre></div></div><div><h3 id=matchesProperty><a href=#matchesProperty class="fa fa-link"></a><code>_.matchesProperty(path, srcValue)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15546>source</a> <a href=https://www.npmjs.com/package/lodash.matchesproperty>npm package</a><p>Creates a function that performs a partial deep comparison between the value at <code>path</code> of a given object to <code>srcValue</code>, returning <code>true</code> if the object value is equivalent, else <code>false</code>.<br><br><strong>Note:</strong> Partial comparisons will match empty array and empty object <code>srcValue</code> values against any array or object value, respectively. See <a href=#isEqual><code>_.isEqual</code></a> for a list of supported value comparisons.<h4>Since</h4><p>3.2.0<h4>Arguments</h4><ol><li><code>path</code> <em>(Array|string)</em>: The path of the property to get.<li><code>srcValue</code> <em>(*)</em>: The value to match.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new spec function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [</div><div>  { <span class=string>'a'</span>: <span class=numeric>1</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>2</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>3</span> }<span class=delimiter>,</span></div><div>  { <span class=string>'a'</span>: <span class=numeric>4</span><span class=delimiter>,</span> <span class=string>'b'</span>: <span class=numeric>5</span><span class=delimiter>,</span> <span class=string>'c'</span>: <span class=numeric>6</span> }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=support>find</span>(objects<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>matchesProperty</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=numeric>4</span>));</div><div><span class=comment>// => { 'a': 4, 'b': 5, 'c': 6 }</span></div></pre></div></div><div><h3 id=method><a href=#method class="fa fa-link"></a><code>_.method(path, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15574>source</a> <a href=https://www.npmjs.com/package/lodash.method>npm package</a><p>Creates a function that invokes the method at <code>path</code> of a given object. Any additional arguments are provided to the invoked method.<h4>Since</h4><p>3.7.0<h4>Arguments</h4><ol><li><code>path</code> <em>(Array|string)</em>: The path of the method to invoke.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke the method with.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new invoker function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [</div><div>  { <span class=string>'a'</span>: { <span class=string>'b'</span>: _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=numeric>2</span>) } }<span class=delimiter>,</span></div><div>  { <span class=string>'a'</span>: { <span class=string>'b'</span>: _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=numeric>1</span>) } }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>(objects<span class=delimiter>,</span> _<span class=delimiter>.</span><span class=support>method</span>(<span class=string>'a.b'</span>));</div><div><span class=comment>// => [2, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>(objects<span class=delimiter>,</span> _<span class=delimiter>.</span><span class=support>method</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]));</div><div><span class=comment>// => [2, 1]</span></div></pre></div></div><div><h3 id=methodOf><a href=#methodOf class="fa fa-link"></a><code>_.methodOf(object, [args])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15603>source</a> <a href=https://www.npmjs.com/package/lodash.methodof>npm package</a><p>The opposite of <a href=#method><code>_.method</code></a>; this method creates a function that invokes the method at a given path of <code>object</code>. Any additional arguments are provided to the invoked method.<h4>Since</h4><p>3.7.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.<li><code>[args]</code> <em>(...*)</em>: The arguments to invoke the method with.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new invoker function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = _<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>3</span><span class=delimiter>,</span> _<span class=delimiter>.</span>constant)<span class=delimiter>,</span></div><div>    object = { <span class=string>'a'</span>: array<span class=delimiter>,</span> <span class=string>'b'</span>: array<span class=delimiter>,</span> <span class=string>'c'</span>: array };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'a[2]'</span><span class=delimiter>,</span> <span class=string>'c[0]'</span>]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>methodOf</span>(object));</div><div><span class=comment>// => [2, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([[<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'2'</span>]<span class=delimiter>,</span> [<span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'0'</span>]]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>methodOf</span>(object));</div><div><span class=comment>// => [2, 0]</span></div></pre></div></div><div><h3 id=mixin><a href=#mixin class="fa fa-link"></a><code>_.mixin([object=lodash], source, [options={}])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15645>source</a> <a href=https://www.npmjs.com/package/lodash.mixin>npm package</a><p>Adds all own enumerable string keyed function properties of a source object to the destination object. If <code>object</code> is a function, then methods are added to its prototype as well.<br><br><strong>Note:</strong> Use <a href=#runInContext><code>_.runInContext</code></a> to create a pristine <code>lodash</code> function to avoid conflicts caused by modifying the original.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[object=lodash]</code> <em>(Function|Object)</em>: The destination object.<li><code>source</code> <em>(Object)</em>: The object of functions to add.<li><code>[options={}]</code> <em>(Object)</em>: The options object.<li><code>[options.chain=true]</code> <em>(boolean)</em>: Specify whether mixins are chainable.</ol><h4>Returns</h4><p><em>(*)</em>: Returns <code>object</code>.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>function</span> <span class=name>vowels</span>(string) {</div><div>  return _<span class="delimiter method">.</span><span class=name>filter</span>(string<span class=delimiter>,</span> <span class=type>function</span>(v) {</div><div>    return<span class=string> /[aeiou]/i</span><span class="delimiter method">.</span><span class=support>test</span>(v);</div><div>  });</div><div>}</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>mixin</span>({ <span class=string>'vowels'</span>: vowels });</div><div>_<span class="delimiter method">.</span><span class=name>vowels</span>(<span class=string>'fred'</span>);</div><div><span class=comment>// => ['e']</span></div><div> </div><div><span class=name>_</span>(<span class=string>'fred'</span>)<span class="delimiter method">.</span><span class=name>vowels</span>()<span class=delimiter>.</span><span class=support>value</span>();</div><div><span class=comment>// => ['e']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>mixin</span>({ <span class=string>'vowels'</span>: vowels }<span class=delimiter>,</span> { <span class=string>'chain'</span>: false });</div><div><span class=name>_</span>(<span class=string>'fred'</span>)<span class="delimiter method">.</span><span class=name>vowels</span>();</div><div><span class=comment>// => ['e']</span></div></pre></div></div><div><h3 id=noConflict><a href=#noConflict class="fa fa-link"></a><code>_.noConflict()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15694>source</a> <a href=https://www.npmjs.com/package/lodash.noconflict>npm package</a><p>Reverts the <code>_</code> variable to its previous value and returns a reference to the <code>lodash</code> function.<h4>Since</h4><p>0.1.0<h4>Returns</h4><p><em>(Function)</em>: Returns the <code>lodash</code> function.<h4>Example</h4><div class="highlight js"><pre><span class=type>var</span> lodash = _<span class="delimiter method">.</span><span class=name>noConflict</span>();</pre></div></div><div><h3 id=noop><a href=#noop class="fa fa-link"></a><code>_.noop()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15713>source</a> <a href=https://www.npmjs.com/package/lodash.noop>npm package</a><p>This method returns <code>undefined</code>.<h4>Since</h4><p>2.3.0<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>noop);</div><div><span class=comment>// => [undefined, undefined]</span></div></pre></div></div><div><h3 id=nthArg><a href=#nthArg class="fa fa-link"></a><code>_.nthArg([n=0])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15737>source</a> <a href=https://www.npmjs.com/package/lodash.ntharg>npm package</a><p>Creates a function that gets the argument at index <code>n</code>. If <code>n</code> is negative, the nth argument from the end is returned.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[n=0]</code> <em>(number)</em>: The index of the argument to return.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new pass-thru function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>nthArg</span>(<span class=numeric>1</span>);</div><div><span class=name>func</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>);</div><div><span class=comment>// => 'b'</span></div><div> </div><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>nthArg</span>(-<span class=numeric>2</span>);</div><div><span class=name>func</span>(<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span><span class=delimiter>,</span> <span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'d'</span>);</div><div><span class=comment>// => 'c'</span></div></pre></div></div><div><h3 id=over><a href=#over class="fa fa-link"></a><code>_.over([iteratees=[_.identity]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15762>source</a> <a href=https://www.npmjs.com/package/lodash.over>npm package</a><p>Creates a function that invokes <code>iteratees</code> with the arguments it receives and returns their results.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[iteratees=[_.identity]]</code> <em>(...(Function|Function[]))</em>: The iteratees to invoke.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>over</span>([<span class=support>Math</span><span class=delimiter>.</span>max<span class=delimiter>,</span> <span class=support>Math</span><span class=delimiter>.</span>min]);</div><div> </div><div><span class=name>func</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span><span class=delimiter>,</span> <span class=numeric>3</span><span class=delimiter>,</span> <span class=numeric>4</span>);</div><div><span class=comment>// => [4, 1]</span></div></pre></div></div><div><h3 id=overEvery><a href=#overEvery class="fa fa-link"></a><code>_.overEvery([predicates=[_.identity]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15788>source</a> <a href=https://www.npmjs.com/package/lodash.overevery>npm package</a><p>Creates a function that checks if <strong>all</strong> of the <code>predicates</code> return truthy when invoked with the arguments it receives.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[predicates=[_.identity]]</code> <em>(...(Function|Function[]))</em>: The predicates to check.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>overEvery</span>([<span class=support>Boolean</span><span class=delimiter>,</span> isFinite]);</div><div> </div><div><span class=name>func</span>(<span class=string>'1'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=name>func</span>(null);</div><div><span class=comment>// => false</span></div><div> </div><div><span class=name>func</span>(NaN);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=overSome><a href=#overSome class="fa fa-link"></a><code>_.overSome([predicates=[_.identity]])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15814>source</a> <a href=https://www.npmjs.com/package/lodash.oversome>npm package</a><p>Creates a function that checks if <strong>any</strong> of the <code>predicates</code> return truthy when invoked with the arguments it receives.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[predicates=[_.identity]]</code> <em>(...(Function|Function[]))</em>: The predicates to check.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> func = _<span class="delimiter method">.</span><span class=name>overSome</span>([<span class=support>Boolean</span><span class=delimiter>,</span> isFinite]);</div><div> </div><div><span class=name>func</span>(<span class=string>'1'</span>);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=name>func</span>(null);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=name>func</span>(NaN);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=property><a href=#property class="fa fa-link"></a><code>_.property(path)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15838>source</a> <a href=https://www.npmjs.com/package/lodash.property>npm package</a><p>Creates a function that returns the value at <code>path</code> of a given object.<h4>Since</h4><p>2.4.0<h4>Arguments</h4><ol><li><code>path</code> <em>(Array|string)</em>: The path of the property to get.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new accessor function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = [</div><div>  { <span class=string>'a'</span>: { <span class=string>'b'</span>: <span class=numeric>2</span> } }<span class=delimiter>,</span></div><div>  { <span class=string>'a'</span>: { <span class=string>'b'</span>: <span class=numeric>1</span> } }</div><div>];</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>(objects<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>property</span>(<span class=string>'a.b'</span>));</div><div><span class=comment>// => [2, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>(_<span class="delimiter method">.</span><span class=name>sortBy</span>(objects<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>property</span>([<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'b'</span>]))<span class=delimiter>,</span> <span class=string>'a.b'</span>);</div><div><span class=comment>// => [1, 2]</span></div></pre></div></div><div><h3 id=propertyOf><a href=#propertyOf class="fa fa-link"></a><code>_.propertyOf(object)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15863>source</a> <a href=https://www.npmjs.com/package/lodash.propertyof>npm package</a><p>The opposite of <a href=#property><code>_.property</code></a>; this method creates a function that returns the value at a given path of <code>object</code>.<h4>Since</h4><p>3.0.0<h4>Arguments</h4><ol><li><code>object</code> <em>(Object)</em>: The object to query.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns the new accessor function.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> array = [<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>2</span>]<span class=delimiter>,</span></div><div>    object = { <span class=string>'a'</span>: array<span class=delimiter>,</span> <span class=string>'b'</span>: array<span class=delimiter>,</span> <span class=string>'c'</span>: array };</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([<span class=string>'a[2]'</span><span class=delimiter>,</span> <span class=string>'c[0]'</span>]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>propertyOf</span>(object));</div><div><span class=comment>// => [2, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>map</span>([[<span class=string>'a'</span><span class=delimiter>,</span> <span class=string>'2'</span>]<span class=delimiter>,</span> [<span class=string>'c'</span><span class=delimiter>,</span> <span class=string>'0'</span>]]<span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>propertyOf</span>(object));</div><div><span class=comment>// => [2, 0]</span></div></pre></div></div><div><h3 id=range><a href=#range class="fa fa-link"></a><code>_.range([start=0], end, [step=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15910>source</a> <a href=https://www.npmjs.com/package/lodash.range>npm package</a><p>Creates an array of numbers <em>(positive and/or negative)</em> progressing from <code>start</code> up to, but not including, <code>end</code>. A step of <code>-1</code> is used if a negative <code>start</code> is specified without an <code>end</code> or <code>step</code>. If <code>end</code> is not specified, it's set to <code>start</code> with <code>start</code> then set to <code>0</code>.<br><br><strong>Note:</strong> JavaScript follows the IEEE-754 standard for resolving floating-point values which can produce unexpected results.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[start=0]</code> <em>(number)</em>: The start of the range.<li><code>end</code> <em>(number)</em>: The end of the range.<li><code>[step=1]</code> <em>(number)</em>: The value to increment or decrement by.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the range of numbers.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>4</span>);</div><div><span class=comment>// => [0, 1, 2, 3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(-<span class=numeric>4</span>);</div><div><span class=comment>// => [0, -1, -2, -3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [1, 2, 3, 4]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>20</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [0, 5, 10, 15]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>0</span><span class=delimiter>,</span> -<span class=numeric>4</span><span class=delimiter>,</span> -<span class=numeric>1</span>);</div><div><span class=comment>// => [0, -1, -2, -3]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => [1, 1, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>range</span>(<span class=numeric>0</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=rangeRight><a href=#rangeRight class="fa fa-link"></a><code>_.rangeRight([start=0], end, [step=1])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15948>source</a> <a href=https://www.npmjs.com/package/lodash.rangeright>npm package</a><p>This method is like <a href=#range><code>_.range</code></a> except that it populates values in descending order.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>[start=0]</code> <em>(number)</em>: The start of the range.<li><code>end</code> <em>(number)</em>: The end of the range.<li><code>[step=1]</code> <em>(number)</em>: The value to increment or decrement by.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the range of numbers.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>4</span>);</div><div><span class=comment>// => [3, 2, 1, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(-<span class=numeric>4</span>);</div><div><span class=comment>// => [-3, -2, -1, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [4, 3, 2, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>0</span><span class=delimiter>,</span> <span class=numeric>20</span><span class=delimiter>,</span> <span class=numeric>5</span>);</div><div><span class=comment>// => [15, 10, 5, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>0</span><span class=delimiter>,</span> -<span class=numeric>4</span><span class=delimiter>,</span> -<span class=numeric>1</span>);</div><div><span class=comment>// => [-3, -2, -1, 0]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>1</span><span class=delimiter>,</span> <span class=numeric>4</span><span class=delimiter>,</span> <span class=numeric>0</span>);</div><div><span class=comment>// => [1, 1, 1]</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>rangeRight</span>(<span class=numeric>0</span>);</div><div><span class=comment>// => []</span></div></pre></div></div><div><h3 id=runInContext><a href=#runInContext class="fa fa-link"></a><code>_.runInContext([context=root])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1427>source</a> <a href=https://www.npmjs.com/package/lodash.runincontext>npm package</a><p>Create a new pristine <code>lodash</code> function using the <code>context</code> object.<h4>Since</h4><p>1.1.0<h4>Arguments</h4><ol><li><code>[context=root]</code> <em>(Object)</em>: The context object.</ol><h4>Returns</h4><p><em>(Function)</em>: Returns a new <code>lodash</code> function.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>mixin</span>({ <span class=string>'foo'</span>: _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'foo'</span>) });</div><div> </div><div><span class=type>var</span> lodash = _<span class="delimiter method">.</span><span class=name>runInContext</span>();</div><div>lodash<span class="delimiter method">.</span><span class=name>mixin</span>({ <span class=string>'bar'</span>: lodash<span class="delimiter method">.</span><span class=name>constant</span>(<span class=string>'bar'</span>) });</div><div> </div><div>_<span class="delimiter method">.</span><span class=name>isFunction</span>(_<span class=delimiter>.</span>foo);</div><div><span class=comment>// => true</span></div><div>_<span class="delimiter method">.</span><span class=name>isFunction</span>(_<span class=delimiter>.</span>bar);</div><div><span class=comment>// => false</span></div><div> </div><div>lodash<span class="delimiter method">.</span><span class=name>isFunction</span>(lodash<span class=delimiter>.</span>foo);</div><div><span class=comment>// => false</span></div><div>lodash<span class="delimiter method">.</span><span class=name>isFunction</span>(lodash<span class=delimiter>.</span>bar);</div><div><span class=comment>// => true</span></div><div> </div><div><span class=comment>// Create a suped-up `defer` in Node.js.</span></div><div><span class=type>var</span> defer = _<span class="delimiter method">.</span><span class=name>runInContext</span>({ <span class=string>'setTimeout'</span>: setImmediate })<span class=delimiter>.</span><span class=support>defer</span>;</div></pre></div></div><div><h3 id=stubArray><a href=#stubArray class="fa fa-link"></a><code>_.stubArray()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15968>source</a> <a href=https://www.npmjs.com/package/lodash.stubarray>npm package</a><p>This method returns a new empty array.<h4>Since</h4><p>4.13.0<h4>Returns</h4><p><em>(Array)</em>: Returns the new empty array.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> arrays = _<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>stubArray);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(arrays);</div><div><span class=comment>// => [[], []]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(arrays[<span class=numeric>0</span>] === arrays[<span class=numeric>1</span>]);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=stubFalse><a href=#stubFalse class="fa fa-link"></a><code>_.stubFalse()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L15985>source</a> <a href=https://www.npmjs.com/package/lodash.stubfalse>npm package</a><p>This method returns <code>false</code>.<h4>Since</h4><p>4.13.0<h4>Returns</h4><p><em>(boolean)</em>: Returns <code>false</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>stubFalse);</div><div><span class=comment>// => [false, false]</span></div></pre></div></div><div><h3 id=stubObject><a href=#stubObject class="fa fa-link"></a><code>_.stubObject()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16007>source</a> <a href=https://www.npmjs.com/package/lodash.stubobject>npm package</a><p>This method returns a new empty object.<h4>Since</h4><p>4.13.0<h4>Returns</h4><p><em>(Object)</em>: Returns the new empty object.<h4>Example</h4><div class="highlight js"><pre><div><span class=type>var</span> objects = _<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>stubObject);</div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(objects);</div><div><span class=comment>// => [{}, {}]</span></div><div> </div><div><span class="name type console">console</span><span class="delimiter method">.</span><span class="support console">log</span>(objects[<span class=numeric>0</span>] === objects[<span class=numeric>1</span>]);</div><div><span class=comment>// => false</span></div></pre></div></div><div><h3 id=stubString><a href=#stubString class="fa fa-link"></a><code>_.stubString()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16024>source</a> <a href=https://www.npmjs.com/package/lodash.stubstring>npm package</a><p>This method returns an empty string.<h4>Since</h4><p>4.13.0<h4>Returns</h4><p><em>(string)</em>: Returns the empty string.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>stubString);</div><div><span class=comment>// => ['', '']</span></div></pre></div></div><div><h3 id=stubTrue><a href=#stubTrue class="fa fa-link"></a><code>_.stubTrue()</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16041>source</a> <a href=https://www.npmjs.com/package/lodash.stubtrue>npm package</a><p>This method returns <code>true</code>.<h4>Since</h4><p>4.13.0<h4>Returns</h4><p><em>(boolean)</em>: Returns <code>true</code>.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>2</span><span class=delimiter>,</span> _<span class=delimiter>.</span>stubTrue);</div><div><span class=comment>// => [true, true]</span></div></pre></div></div><div><h3 id=times><a href=#times class="fa fa-link"></a><code>_.times(n, [iteratee=_.identity])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16064>source</a> <a href=https://www.npmjs.com/package/lodash.times>npm package</a><p>Invokes the iteratee <code>n</code> times, returning an array of the results of each invocation. The iteratee is invoked with one argument; <em>(index)</em>.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>n</code> <em>(number)</em>: The number of times to invoke <code>iteratee</code>.<li><code>[iteratee=_.identity]</code> <em>(Function)</em>: The function invoked per iteration.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the array of results.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>3</span><span class=delimiter>,</span> <span class=support>String</span>);</div><div><span class=comment>// => ['0', '1', '2']</span></div><div> </div><div> _<span class="delimiter method">.</span><span class=name>times</span>(<span class=numeric>4</span><span class=delimiter>,</span> _<span class="delimiter method">.</span><span class=name>constant</span>(<span class=numeric>0</span>));</div><div><span class=comment>// => [0, 0, 0, 0]</span></div></pre></div></div><div><h3 id=toPath><a href=#toPath class="fa fa-link"></a><code>_.toPath(value)</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16099>source</a> <a href=https://www.npmjs.com/package/lodash.topath>npm package</a><p>Converts <code>value</code> to a property path array.<h4>Since</h4><p>4.0.0<h4>Arguments</h4><ol><li><code>value</code> <em>(*)</em>: The value to convert.</ol><h4>Returns</h4><p><em>(Array)</em>: Returns the new property path array.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>toPath</span>(<span class=string>'a.b.c'</span>);</div><div><span class=comment>// => ['a', 'b', 'c']</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>toPath</span>(<span class=string>'a[0].b.c'</span>);</div><div><span class=comment>// => ['a', '0', 'b', 'c']</span></div></pre></div></div><div><h3 id=uniqueId><a href=#uniqueId class="fa fa-link"></a><code>_.uniqueId([prefix=''])</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16123>source</a> <a href=https://www.npmjs.com/package/lodash.uniqueid>npm package</a><p>Generates a unique ID. If <code>prefix</code> is given, the ID is appended to it.<h4>Since</h4><p>0.1.0<h4>Arguments</h4><ol><li><code>[prefix='']</code> <em>(string)</em>: The value to prefix the ID with.</ol><h4>Returns</h4><p><em>(string)</em>: Returns the unique ID.<h4>Example</h4><div class="highlight js"><pre><div>_<span class="delimiter method">.</span><span class=name>uniqueId</span>(<span class=string>'contact_'</span>);</div><div><span class=comment>// => 'contact_104'</span></div><div> </div><div>_<span class="delimiter method">.</span><span class=name>uniqueId</span>();</div><div><span class=comment>// => '105'</span></div></pre></div></div></div><div><h2><code>Properties</code></h2><div><h3 id=VERSION><a href=#VERSION class="fa fa-link"></a><a href=#VERSION><code>_.VERSION</code></a></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L16814>source</a><p>(string): The semantic version number.</div><div><h3 id=templateSettings><a href=#templateSettings class="fa fa-link"></a><a href=#templateSettings><code>_.templateSettings</code></a></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1738>source</a> <a href=https://www.npmjs.com/package/lodash.templatesettings>npm package</a><p>(Object): By default, the template delimiters used by lodash are like those in embedded Ruby <em>(ERB)</em>. Change the following template settings to use alternative delimiters.</div><div><h3 id=templateSettings-escape><a href=#templateSettings-escape class="fa fa-link"></a><code>_.templateSettings.escape</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1746>source</a><p>(RegExp): Used to detect <code>data</code> property values to be HTML-escaped.</div><div><h3 id=templateSettings-evaluate><a href=#templateSettings-evaluate class="fa fa-link"></a><code>_.templateSettings.evaluate</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1754>source</a><p>(RegExp): Used to detect code to be evaluated.</div><div><h3 id=templateSettings-imports><a href=#templateSettings-imports class="fa fa-link"></a><code>_.templateSettings.imports</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1778>source</a><p>(Object): Used to import variables into the compiled template.</div><div><h3 id=templateSettings-interpolate><a href=#templateSettings-interpolate class="fa fa-link"></a><code>_.templateSettings.interpolate</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1762>source</a><p>(RegExp): Used to detect <code>data</code> property values to inject.</div><div><h3 id=templateSettings-variable><a href=#templateSettings-variable class="fa fa-link"></a><code>_.templateSettings.variable</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1770>source</a><p>(string): Used to reference the data object in the template text.</div></div><div><h2><code>Methods</code></h2><div><h3 id=templateSettings-imports-_><a href=#templateSettings-imports-_ class="fa fa-link"></a><code>_.templateSettings.imports._</code></h3><p><a href=https://github.com/lodash/lodash/blob/4.17.2/lodash.js#L1786>source</a><p>A reference to the <code>lodash</code> function.</div></div></div></div>